GSReddy
GSReddy

Reputation: 137

Exception: ClassNotFoundException: com.mysql.jdbc.Driver

I am doing a simple JSP program to connect with MySQL DB. But it's showing the Exception like this. I am using Java version 1.6 and MySQL -connector 5.1.20. I have placed this connector (.jar) file in lib/ext directory of JAVA_HOME. I have set the CLASSPATH also to the value upto connector (.JAR) file. Still, I get the same Exception.

I have searched for this. I did all the things suggested by them. But I didn't found any results.

Please help me.

Upvotes: 0

Views: 546

Answers (2)

Shaikh Azhar Alam
Shaikh Azhar Alam

Reputation: 165

If you are using Netbeans, then right click on your project, select "Add library," then select MySQL JDBC driver and save it.

Upvotes: 0

Harshal Waghmare
Harshal Waghmare

Reputation: 1944

Place the connector jar in the TOMCAT_HOME/lib folder of your tomcat installation. It should work.

Upvotes: 3

Related Questions