赞
踩
工具和环境
ubuntu16.0.4
idea17
mysql5.7
c3p0 0.9.5.2
mysql-connector-java
主要的报错句子:
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
Caused by: java.sql.SQLException: Access denied for user 'linyc'@'localhost' (using password: YES)
原因:
c3p0.properties配置文件中的属性名前要加c3p0
我早上用的是windows系统的idea不加c3p0前缀依然正确,但晚上用了ubuntu的idea配置c3p0配置文件时不加前缀就出问题了。
参考:https://blog.csdn.net/zhoucheng05_13/article/details/53352003
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。