用eclipse工具中,运用到c3p0连接池,出现以下错误。

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

我的原因是c3p0配置文件的问题:

正确如下:

<?xml version="1.0" encoding="UTF-8"?>
<c3p0-config>
  <default-config>
      <property name="driverClass">com.mysql.jdbc.Driver</property>
      <property name="jdbcUrl">jdbc:mysql://localhost:3306/db_czjf</property> //这里要和mysql对应
      <property name="user">root</property> //数据库用户名
      <property name="password">123456</property>//数据库密码
      <property name="maxPoolSize">20</property>
  </default-config>
</c3p0-config>

C3P0连接数据库的问题

要对应起来’。

相关文章:

  • 2021-12-10
  • 2021-07-30
  • 2022-12-23
  • 2021-06-29
  • 2021-08-03
  • 2022-12-23
  • 2022-01-03
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2021-08-13
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案