0

I got this error when I use Class.forName[...]. I used the JConnector MSI Installer (http://dev.mysql.com/downloads/connector/j/5.1.html) so I got no ZIP file to add to my build path or I don't know where the installer put it.

Any ideas?

8

1 Answer 1

1

Try to insert this:

DriverManager.registerDriver(new com.mysql.jdbc.Driver());

before getting the JDBC Connection.

Other option :

1: Download the mysql-connector-java.jar

2: You need to drop JAR in /WEB-INF/lib folder.

3: properties of project->build path->add JAR and selected the JAR above.

3
  • Which server you are using? Commented Oct 21, 2015 at 8:48
  • Apache, and I'm using XAMPP if this is kind of helpful. Commented Oct 21, 2015 at 8:51
  • Thanks! I created the project as a Dynamic Web Project and follow your instructions with the /WEB/INF/lib and the build path ;) Works! Commented Oct 21, 2015 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.