1一1

c3p0读取配置文件 Access denied for user 'Administrator'@'localhost' (using password: YES)

一开始的资源文件为这样

driver=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://localhost:3306/smbms?useSSL=true&useUnicode=true&characterEncoding=UTF-8
username=root
pwd=xxx

c3p0配置文件

<bean id="dataSources" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="driverClass" value="${jdbc.driver}"/>
    <property name="jdbcUrl" value="${jdbc.url}"/>
    <property name="user" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
    <!-- c3p0连接池的私有属性 -->

后来解决办法 把properties文件前面格式写规范再测试就好了 ... 真坑

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssmbuild?useSSL=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT
jdbc.username=root
jdbc.password=xxx

posted on 2021-11-23 15:30  1一1  阅读(63)  评论(0编辑  收藏  举报