Sping3整合c3p0数据源报异常

异常如下:

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:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值