The following error occurred while connecting to the database in Java:

Source: Internet
Author: User

Java.lang.ClassNotFoundException:com.mysql.jdbc.driverat Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1438) at Org.apache.catalina.loader.WebappClassLoader.loadClass (Webappclassloader.java:1284) at JAVA.LANG.CLASS.FORNAME0 (Native Method) at Java.lang.Class.forName (Unknown Source) at Com.skybird.util.SqlHelper.<clinit> (sqlhelper.java:47) at Com.skybird.model.UserService.checkUser (Userservice.java:25) at Com.skybird.controller.LoginVerify.doPost (Loginverify.java:47) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:647) at Javax.servlet.http.HttpServlet.service (Httpservlet.java:729) at Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Applicationfilterchain.java:269) at Org.apache.catalina.core.ApplicationFilterChain.doFilter (Applicationfilterchain.java:188) at Org.apache.catalina.core.StandardWrapperValve.invoke (Standardwrappervalve.java:213) at Org.apache.catalina.core.StandardContextValve.invoke (Standardcontextvalve.java:172) at Org.apache.catalina.core.StandardHostValve.invoke (Standardhostvalve.java:127) at Org.apache.catalina.valves.ErrorReportValve.invoke (Errorreportvalve.java:117) at Org.apache.catalina.core.StandardEngineValve.invoke (Standardenginevalve.java:108) at Org.apache.catalina.connector.CoyoteAdapter.service (Coyoteadapter.java:174) at Org.apache.coyote.http11.Http11Processor.process (Http11processor.java:881) at Org.apache.coyote.http11.http11baseprotocol$http11connectionhandler.processconnection ( Http11baseprotocol.java:674) at Org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (Pooltcpendpoint.java:541) at Org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (Leaderfollowerworkerthread.java:81) at Org.apache.tomcat.util.threads.threadpool$controlrunnable.run (Threadpool.java:689) at Java.lang.Thread.run (Unknown Source)

Then fix the error:

Java error when connecting to MySQL: Java.lang.ClassNotFoundException:com.mysql.jdbc.Driver (2013-08-14 15:20:12) reprint tag: Java MySQL The     solution is as follows: MySQL-connector-java-5.1.26-bin.jar to be imported into the project. In eclipse, just right-click the project folder Properties option -java  Build path-addextenal Archives added ... You can see it in the. classpath file after joining

Reference instance:

Http://www.cnblogs.com/longwu/articles/2310577.html

Problem-Solving References:

Http://blog.sina.com.cn/s/blog_9c5d29f70101ckuu.html

Other solutions that have similar problems are different;

The following error occurred while connecting to the database in Java:

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.