当前位置: 代码迷 >> J2SE >> C3P0 : 出错 An attempt by a client to checkout a Connection has timed out
  详细解决方案

C3P0 : 出错 An attempt by a client to checkout a Connection has timed out

热度:835   发布时间:2016-04-23 20:37:54.0
C3P0 : 报错 An attempt by a client to checkout a Connection has timed out.
C3P0 :  中途报错       An attempt by a client to checkout a Connection has timed out.
测试用的配置:
dataSource = new ComboPooledDataSource();
dataSource.setUser("root");
dataSource.setPassword("");
dataSource
.setJdbcUrl("jdbc:mysql://localhost:3306/vst?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&maxReconnects=10");
dataSource.setDriverClass("");
dataSource.setInitialPoolSize(2);
dataSource.setMinPoolSize(20);
dataSource.setMaxPoolSize(20);
dataSource.setMaxStatements(0);
dataSource.setMaxIdleTime(60);
dataSource.setCheckoutTimeout(1000);
dataSource.setIdleConnectionTestPeriod(60);
项目需要频繁的向数据库插入或查询数据                        






------解决方案--------------------
是不是应该设置个密码,有时候空密码会出莫名其妙的问题,还有可以试试吧超时时间设的长点。。。
  相关解决方案