0
Follow
0
View

mybatis cannot connect to the database

dgsdeng 注册会员
2023-02-27 16:06

img


There are tables, there are xml configuration files( https://mybatis.org/mybatis-3/zh/getting-started

< P >
dongxiaoyi1985 注册会员
2023-02-27 16:06
< div class = " md_content_show“数据- v - 3967 e397 = " " >

核心配置文件
xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0modelVersion>

    
    <groupId>com.itheimagroupId>
    <artifactId>maven-demoartifactId>
    <version>1.0-SNAPSHOTversion>

    
    <dependencies>
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>5.1.46version>
            <scope>testscope>
        dependency>

        
        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>druidartifactId>
            <version>1.1.12version>
        dependency>
        
        <dependency>
            <groupId>org.mybatisgroupId>
            <artifactId>mybatisartifactId>
            <version>3.5.5version>
        dependency>
        
        <dependency>
            <groupId>junitgroupId>
            <artifactId>junitartifactId>
            <version>4.13version>
            <scope>testscope>
        dependency>

        
        <dependency>
            <groupId>org.slf4jgroupId>
            <artifactId>slf4j-apiartifactId>
            <version>1.7.20version>
        dependency>
        
        <dependency>
            <groupId>ch.qos.logbackgroupId>
            <artifactId>logback-classicartifactId>
            <version>1.2.3version>
        dependency>
        
        <dependency>
            <groupId>ch.qos.logbackgroupId>
            <artifactId>logback-coreartifactId>
            <version>1.2.3version>
        dependency>

    dependencies>

project>

dowei2008 注册会员
2023-02-27 16:06

I rewrote the mysql/Druid package above. The problem changed

img

didadoc 注册会员
2023-02-27 16:06
< div class = "md_content_show e397 data - v - 3967" = "" >

oh oh Can the I lose password wrong

djj125 注册会员
2023-02-27 16:06

mysql driver jar package not imported, check

img

dongdehui5210 注册会员
2023-02-27 16:06

img


Some of these are OK, I don't need to create a file on top of it, let's do it again