Ideal to solve java.lang.ClassNotFoundException under the web: com.mysql.jdbc.Driver

	Class.forName(driverClass);//源代码
	解决方法:

a. Confirm that the package has been imported into the webproject folder.
b. Import mysql-connector-java-3.1.13-bin.jar into the tomcat lib folder below.

As in the web project. When Class.forName ("om.mysql.jdbc.Driver") ;, the compiler will not search for the string and the driver. Just need to copy mysql-connector-java-3.1.13-bin.jar to the lib folder under tomcat.
Of course in the java project. Just need to introduce mysql-connector-java-5.1.7-bin.jar to execute java project.
I do n’t know if there are other ways!
This one is also available to others. Take a note.

Published 37 original articles · won praise 6 · views 4670

Guess you like

Origin blog.csdn.net/littlewhitevg/article/details/89058916