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);
项目需要频繁的向数据库插入或查询数据
------解决方案--------------------
是不是应该设置个密码,有时候空密码会出莫名其妙的问题,还有可以试试吧超时时间设的长点。。。