Problems with the MySQL Connector
Written by Oz Warren Tuesday, 02 February 2010 18:50
Familiarity breeds contempt. Lack of familiarity breeds incompetence. I recently loaded up an old Struts project in Netbeans, running on Apache Tomcat and using the MySQL connector in JDBC.
I loaded the project in a new install of Netbeans 6.8 and after a few tweaks, got the error "cannot load jdbc driver class com.mysql.jdbc.driver" even though I had added the right JAR file to the library and the code was otherwise correct. What I'd forgotten was that you need to move/copy the JAR file to the lib directory of your Tomcat installtion and change the location that the MySQL library entry refers to in Netbeans.
Once this was changed, it worked fine.
Doh!


