Several solutions to the emergence of java.sql.SQLException:No suitable driver

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.