Recently, I downloaed JDBC driver for MySQL to test a JSF page. The downloaded file was mysql-connector-java-5.1.16.zip and I put it into WEB-INF/lib directory. I set the class path including the file.
When I compiled my code, the Eclipse console was complaining "java.lang.ClassNotFoundException:com.mysql.jdbc.Driver" vomitting many lines of red messages. What's wrong? I already added the JDBC connector and set the class path correctly. So I opened then dowloaded file by an unzip untility and there was no .class file but .java.
I got a .jar file and put it into lib folder and executed my code... then it worked well.
I felt like that I was cheated by Oracle. (Because MySQL was merged by Oracle.)
In addition, you can download JDBC file for MySQL with .jar format from the following site:
http://www.jarfinder.com/index.php/java/info/com.mysql.jdbc.Driver
When I compiled my code, the Eclipse console was complaining "java.lang.ClassNotFoundException:com.mysql.jdbc.Driver" vomitting many lines of red messages. What's wrong? I already added the JDBC connector and set the class path correctly. So I opened then dowloaded file by an unzip untility and there was no .class file but .java.
I got a .jar file and put it into lib folder and executed my code... then it worked well.
I felt like that I was cheated by Oracle. (Because MySQL was merged by Oracle.)
In addition, you can download JDBC file for MySQL with .jar format from the following site:
http://www.jarfinder.com/index.php/java/info/com.mysql.jdbc.Driver
Comments
Post a Comment