平台:bsd6.2+diable jdk1.5 +mysql 4.1+hibernate3.2+c3p0 php能连mysql,jdbc死活连不上mysql,请大侠帮忙看看
代码是经过本地window开发环境测试的。
Jul 9, 2008 2:16:34 AM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Jul 9, 2008 2:16:34 AM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1-pre9 [built 23-September-2006 01:47:24; debug? true; trace: 10]
Jul 9, 2008 2:16:34 AM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@8099f75a [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@a7857b78 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 26f9e5, idleConnectionTestPeriod -> 18000, initialPoolSize -> 30, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 30, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@a010c661 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 5b675e, jdbcUrl -> jdbc:mysql://localhost:3306/inlife?autoReconnect=true&useUnicode=true&characterEncoding=gbk&mysqlEncoding=gbk, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 16877f8, numHelperThreads -> 3 ]
Jul 9, 2008 2:16:54 AM com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run
WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1263db -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
Jul 9, 2008 2:16:54 AM com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector run
WARNING: com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@1263db -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1389b3f (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@158689a (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@13b5a3a (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1a0b53e
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1dafb4e
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1a8d460
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@10f0625
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@15c97e4
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1f8247d
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@23bdd1
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@830122
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@bf7916
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@a6af6e
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1478a2d
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1c09624
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@c1186f
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@12b3349
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@134263a
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@b9b8d0
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1148603
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6a63d3
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@bfed5a
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@77eb97
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@10c3a08
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1b6235b
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@cb42cf
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@8f2ca6
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1bc4ec8
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1d840d9
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@898540
Pool thread stack traces:
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:516)
java.net.Socket.connect(Socket.java:466)
java.net.Socket.<init>(Socket.java:366)
java.net.Socket.<init>(Socket.java:20
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:147)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2769)
com.mysql.jdbc.Connection.<init>(Connection.java:1531)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:862)
com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:33)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1527)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:516)
java.net.Socket.connect(Socket.java:466)
java.net.Socket.<init>(Socket.java:366)
java.net.Socket.<init>(Socket.java:20
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:147)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2769)
com.mysql.jdbc.Connection.<init>(Connection.java:1531)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:862)
com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:33)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1527)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:516)
java.net.Socket.connect(Socket.java:466)
java.net.Socket.<init>(Socket.java:366)
java.net.Socket.<init>(Socket.java:20
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:147)
com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
com.mysql.jdbc.Connection.createNewIO(Connection.java:2769)
com.mysql.jdbc.Connection.<init>(Connection.java:1531)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:862)
com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:33)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1527)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
cp30版本我能换的都换过 至少换过4个版本
mysql4.1 的java驱动 3.1 5.x能下的我都换过。都是一样的错误。
郁闷的是我的php居然能连mysql。
为何jdbc就不能连上呢??
--转自