将光标移到/点击文章中的句子上,可以查看译文。      显示繁体中文内容    显示简体中文内容

jdbc type 4 -java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
jdbc类型 4 java.lang. ClassNotFoundException: com.mysql. jdbc.Driver

0 0

possible Duplicate :
ClassNotFoundException com.mysql. jdbc.Driver

Hi i am beginner in java and i have created a java program in eclipse using jdbc type 4.

I got an error :java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

so can you please help me in resolving this error.

Thanks in advance

时间: 原作者:

0 0

You need MySQL Connector jar which is not in classpath.Add it in your classpath

原作者:
0 0

Two ways

1) Run java app with classpath

Windows


java -classpath. ;mysqljarfile.jar YourApplication

Linux


java -classpath. :mysqljarfile.jar YourApplication

2) Define it in your manifest file


Manifest-Version: 1.0
Class-Path: mysqljarfile.jar 
Main-Class: mainClass

0 0

Add your mysql connector jar file to your project WEB-INFlib folder and redeploy again.

原作者:
...