配置文件无任何问题,目前在网上未找到解决方案。
Java工程使用jdk13会出现以下问题:
Mar 04, 2020 6:38:21 PM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Mar 04, 2020 6:38:21 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
Mar 04, 2020 6:38:21 PM com.mchange.v2.c3p0.cfg.C3P0Config getUnspecifiedUserProperties
WARNING: named-config with name 'myc3p0' does not exist. Using default-config.
Mar 04, 2020 6:38:21 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> myc3p0, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> null, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> z8kfsxa819tdx229c87dt|4d3167f4, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
使用jdk1.8不会出现以上问题。刚开始学java先标记一下,以后再来解决。
代码:
@Test
public void ConnTest2() throws SQLException{
ComboPooledDataSource cpds = new ComboPooledDataSource("myc3p0");
Connection conn = cpds.getConnection();
System.out.println(conn);
}
xml配置文件:
com.mysql.jdbc.Driver
jdbc:mysql:///test
root
root
5
5
5
10
5
2