Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
来源:互联网 发布:c语言问号表达式 编辑:程序博客网 时间:2024/06/14 18:57
2015-01-10 16:00
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 lee.BeanTest.main(BeanTest.java:26)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)... 2 more-------------------代码public static void main(String[] args)throws Exception{ApplicationContext ctx = newClassPathXmlApplicationContext("bean.xml");DataSource ds = (DataSource)ctx.getBean("dataSource");Connection conn = ds.getConnection();PreparedStatement pstmt = conn.prepareStatement("insert into news_inf value(null , ? , ?)");pstmt.setString(1 , "XXXX");pstmt.setString(2 , "YYYY");pstmt.executeUpdate();pstmt.close();conn.close();}bean。xml就不发出来了,上面与c3p0数据源的配置 是OK的 ------------------------------应该是连接mysql的密码出错了
2015-01-10 16:00白羊luojishu | 分类:数据库DB | 浏览15次
Exception in thread "main" 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 lee.BeanTest.main(BeanTest.java:26)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)... 2 more-------------------代码public static void main(String[] args)throws Exception{ApplicationContext ctx = newClassPathXmlApplicationContext("bean.xml");DataSource ds = (DataSource)ctx.getBean("dataSource");Connection conn = ds.getConnection();PreparedStatement pstmt = conn.prepareStatement("insert into news_inf value(null , ? , ?)");pstmt.setString(1 , "疯狂Java讲义");pstmt.setString(2 , "Struts 2权威指南");pstmt.executeUpdate();pstmt.close();conn.close();}bean。xml就不发出来了,上面与c3p0数据源的配置 是OK的
0 0
- Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
- Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
- 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!
- 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: 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!
- 关于java.sql.SQLException: Connections could not be acquired from the underlying database!
- c3p0 配置连接MySQL异常: java.sql.SQLException: Connections could not be acquired from the underlying datab
- c3p0连接池连接失败:java.sql.SQLException: Connections could not be acquired from the underlying database!
- Connections could not be acquired from the underlying database!
- 解决:Connections could not be acquired from the underlying database
- Connections could not be acquired from the underlying database!
- 解决:Connections could not be acquired from the underlying database!
- Connections could not be acquired from the underlying database
- Connections could not be acquired from the underlying database
- 解决:Connections could not be acquired from the underlying database!
- 设计模式-模版方法模式
- android共享数据之SharedPreferences-组建间的数据共享和应用间的数据共享
- Core Animation之CATransform3D学习篇
- 操作系统IO模型
- 正则表达式 - 匹配规则
- Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
- 一句话脚本系列之获取eth0网卡的IP地址(或MAC地址)
- HDU5139 Card 求期望
- opencv从两路视频中获取图片
- 基础之Git分布式版本控制系(转)
- 【项目管理】 PMBOK 基础概念 (引论 PMBOK 笔记)
- android背景选择器selector用法汇总
- MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError
- 深入理解Android(5)——从MediaScanner分析Android中的JNI