DRastislav
DRastislav

Reputation: 1882

Class not Found MySQL connector in Servlet

I have a question about MySQL connector - In my servlet i use connector-

mysql-connector-java-5.1.18-bin.jar

as String driver = "com.mysql.jdbc.Driver";

than in try block i create new Instance using

 Class.forName(driver).newInstance();

but after click on my "Search" button - i have an error:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I have my Mysql Connector in My Project WebContent\WEB-INF\lib\ folder and I have it in Projects build Path as well, but I still have an exception.

What shall i check or how can i get rid of this?

Thanks

Upvotes: 0

Views: 92

Answers (1)

Eran
Eran

Reputation: 393836

Since you are using Apache Tomcat for your server, you should put the connector jar in the lib folder of the Tomcat installation.

Upvotes: 1

Related Questions