Exception in thread "main" java.lang.RuntimeException: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.jfinal.plugin.activerecord.generator.MetaBuilder.build(MetaBuilder.java:102)
at com.jfinal.plugin.activerecord.generator.Generator.generate(Generator.java:210)
at com.demo.common.model._JFinalDemoGenerator.main(_JFinalDemoGenerator.java:45)
Caused by: 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 com.jfinal.plugin.activerecord.generator.MetaBuilder.build(MetaBuilder.java:90)
... 2 more
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)
... 4 more
这类错误无非就是如下几个原因:
1:连接数据库的用户名错误,密码错误
2:数据库名错误
3:连接用的用户账号没有权限
总之是配置的问题