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

Community
  • 1
  • 1
user1450954
  • 237
  • 1
  • 3
  • 10

3 Answers3

1

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

Nandkumar Tekale
  • 16,024
  • 8
  • 58
  • 85
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

Add your mysql connector jar file to your project WEB-INF\lib folder and redeploy again.

Sai Ye Yan Naing Aye
  • 6,622
  • 12
  • 47
  • 65
  • Communication failure during handshake. Is there a server running on localhost:3306? i tried adding the jar file and now – user1450954 Jul 30 '12 at 08:41