首页 > 技术文章 > com.mchange.v2.resourcepool.CannotAcquireResourceException

share2015 2016-03-13 12:07 原文

Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underlying database!
<pre name="code" class="html">Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.



这是链接不到数据库,原因多种,我遇到一种,就是我的数据库没有设置密码,而我设置了密码去使用

user=root
password=123
driverclass=com.mysql.jdbc.Driver
jdbcurl=jdbc:mysql://localhost:3306/hibernate


后来改成无密码,则对上了

user=root
password=
driverclass=com.mysql.jdbc.Driver
jdbcurl=jdbc:mysql://localhost:3306/hibernate


推荐阅读