Today, when I connected MySQL database with C3P0, there was an error,
In general, this error has 3 directions to solve the problem is generally DB configuration, be careful to configure the DB
August 19, 2017 8:30:46 pm Com.mchange.v2.resourcepool.basicresourcepool$acquiretask Run
Warning: [Email protected]95--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 at tempts (30). Last acquisition attempt exception:
Java.sql.SQLException:No Suitable driver
At Java.sql.DriverManager.getDriver (Unknown Source)
At Com.mchange.v2.c3p0.DriverManagerDataSource.driver (drivermanagerdatasource.java:223)
At Com.mchange.v2.c3p0.DriverManagerDataSource.getConnection (drivermanagerdatasource.java:134)
At Com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection (Wrapperconnectionpooldatasource.java : 182)
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)
1.: (1) It is very likely that there is a problem with the configuration file in C3p0-config.xml
These configurations must be configured correctly, like the first picture forgot a "colon"
2) put the jar package into the Java Lib directory
Place a jar package that connects to the MySQL database under the Jre\lib\ext file (such as E:\jdk8\jre\lib\ext) in the Java_home directory Mysql-connector-java-****-bin.jar
3) Jar package not added to BuildPath
See if the jar bag is in referenced Libraries.
Several solutions to the emergence of java.sql.SQLException:No suitable driver