异常如下:
2011-09-11 17:12:02,420 WARN (com.mchange.v2.c3p0.impl.NewPooledConnection:139) - com.microsoft.jdbc.sqlserver.SQLServerConnection@a5c26a threw an Error when we tried to check its default holdability. This is probably due to a bug in your JDBC driver that c3p0 can harmlessly work around (reported for some DB2 drivers). Please verify that the error stack trace is consistentwith the getHoldability() method not being properly implemented, and is not due to some deeper problem. This message will not be repeated for Connections of type com.microsoft.jdbc.sqlserver.SQLServerConnection that provoke errors of type java.lang.AbstractMethodError when getHoldability() is called.
java.lang.AbstractMethodError
at com.mchange.v2.c3p0.impl.NewPooledConnection.carefulCheckHoldability(NewPooledConnection.java:117)
at com.mchange.v2.c3p0.impl.NewPooledConnection.<init>(NewPooledConnection.java:109)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:198)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
2011-09-11 17:12:02,420 INFO (com.mchange.v2.c3p0.SQLWarnings:43) - [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to Aegis_PROD
原因是数据库链接url的驱动类名和url需要更新,方法如下:
驱动类名由com.microsoft.jdbc.sqlserver.SQLServerDriver修改为net.sourceforge.jtds.jdbc.Driver
url由jdbc:microsoft:sqlserver:修改为 jdbc:jtds:sqlserver: