<?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