搜索

首页  >  问答  >  正文

java - c3p0连接池 异常

java.sql.SQLException: Connections could not be acquired from the underlying database!
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)
    at dao.DbConnect.getConByC3P0(DbConnect.java:18)
    at dao.DbConnect.main(DbConnect.java:46)
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
    at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319)
    at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)
    at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)
    ... 3 more
c3p0.driverClass=com.mysql.jdbc.Driver  
c3p0.jdbcUrl=jdbc:mysql://****:3306/mpaper_cms2?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
c3p0.user=portal
c3p0.password=portal

c3p0.initialPoolSize=5
c3p0.minPoolSize=5
c3p0.maxPoolSize=10
迷茫迷茫2767 天前587

全部回复(2)我来回复

  • 高洛峰

    高洛峰2017-04-18 10:32:15

    应该是这个没有转意0.0试试看
    c3p0.jdbcUrl=jdbc:mysql://**:3306/mpaper_cms2?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull

    回复
    0
  • 巴扎黑

    巴扎黑2017-04-18 10:32:15

    为什么不直接填写ip地址或者localhost呢?这样就应该不会报错了吧

    回复
    0
  • 取消回复