Open source software supply chain lighting plan, waiting for you>>>
1. Reference connection:
https://blog.csdn.net/huangbiao86/article/details/6428608
After tossing all morning, I found out the cause of the mistake. Ah… Tragedy
Confirm that the package has been imported into the web project directory
It turned out that Tomcat could not find the MySQL jar package. Later, I imported mysql-connector-java-5.1.7-bin.jar into Tomcat’s lib directory, and it was OK. Hey
In Java project, you only need to introduce mysql-connector-java-5.1.7-bin.jar to run java project
In Web project, when class. Forname (“OM. Mysql. JDBC. Driver”); MyEclipse doesn’t look for strings or drivers. So just copy mysql-connector-java-5.1.7-bin.jar to Tomcat’s lib directory
Similar Posts:
- [Solved] servlet jump to Blank Page Error: java.lang.ClassNotFoundException: com.mysql.jdbc.
- Error occurred when Android connected to cloud MySQL: java.lang.NoClassDefFoundError : Failed resolution of: Ljava/sql/SQLType
- The jdbc driver imported from idea into MySQL appears “Java. Lang. classnotfoundexception: com. Mysql. CJ. JDBC. Driver”
- [Solved] Sqoop error: Could not load db driver class: com.mysql.jdbc.Driver
- [Solved] Mybatis Codes Error: java.lang.ClassNotFoundException: Cannot find class: com.mysql.jdbc.Driver
- [Solved] JSP Use MySQL database Error: java.lang.classnotfoundexception: com.mysql.jdbc.driver
- [Solved] MySQL Error: com.mysql.cj.jdbc.util.TimeUtil.loadTimeZoneMappings(TimeUtil.java:163)
- MySQL connection error no suitable driver found [How to Solve]
- Logstash output jdbc Error: java.lang.IllegalAccessError: tried to access class com.mysql.jdbc.EscapeProcessor from class com.mysql.jdbc.ConnectionImpl
- [Solved] Python import module error: importerror: no module named mysql.connector