解决方法
在数据库连接配置db.properties文件中的属性前增加前缀
- xml配置
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="url" value="${jdbc.url}"/>
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="defaultAutoCommit" value="true"/>
</bean>
- db.properties
jdbc.driver = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://localhost:3306/mybatis?useSSL=false&useUnicode=ture&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
jdbc.username = root
jdbc.password = 123456
标签:jdbc,数据源,db,Druid,报错,mysql
From: https://www.cnblogs.com/yinchrn/p/17280660.html