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

Source: Internet
Author: User

<?xml version= "1.0" encoding= "UTF-8"?>
<c3p0-config>
<default-config>
<property name= "Jdbcurl" >jdbc:mysql://localhost:3306/day15</property>
<property name= "Driverclass" >com.mysql.jdbc.Driver</property>
<property name= "User" >root</property>
<property name= "Password" >123456</property>
<property name= "Acquireincrement" >3</property>
<property name= "Initialpoolsize" >10</property>
<property name= "Minpoolsize" >2</property>
<property name= "Maxpoolsize" >10</property>
</default-config>
</c3p0-config>

Cause: (1) It is very likely that the c3p0-config.xml in the configuration file problems, such as I was because of the "Driverclass" accidentally written "driver", so in writing c3p0-config.xml to be particularly careful, may be more a space or format slightly             If there is a problem, the above error will be reported.            such as: Driver class write wrong, Jdbcurl format error and so on.            Solution: Carefully check the writing is correct!!!              (2) There is no place to add the Mysql-connector-java-****-bin.jar package to the external jar package in the Java Runtime environment. Solution: 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) There is also a literal meaning: you do not have the applicable driver. Workaround: Check whether the appropriate Mysql-connector-java-****-bin.jar package is imported under the Webroot\web-inf\lib directory, and then restart the server without importing it.

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

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.