关于 c3p0-config.xml 配置的一个小问题

抛出的异常:

   com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1434ded5 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
java.sql.SQLException: No suitable driver

   com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@74659e95 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
java.sql.SQLException: No suitable driver

   com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@14375ad3 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: 
java.sql.SQLException: No suitable driver

解决方法:

    出现上面的问题原因是 c3p0 没有找到合适的驱动,所以大批量的报错。我使用的驱动是 connector 8.0 ,c3p0 的版本是0.9.5.2 ,在配置的时候依照 8.0 版本的驱动是自动加载的,所以并没有进行手动配置。后面的各种报错原因也是这个,所以解决这个问题的方法也很简单,加上驱动的配置 com.mysql.cj.jdbc.Driver 就好了。

    经过调试,完美解决问题。

    

你可能感兴趣的:(关于 c3p0-config.xml 配置的一个小问题)