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

2

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

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

2 Comments

I misread. In eclipse you can add library in Properties/JavaBuildPath
I have been creating this program using eclipse so how do i set the class path in eclipse ?
0

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

1 Comment

Communication failure during handshake. Is there a server running on localhost:3306? i tried adding the jar file and now

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.