I'm getting ClassNotFoundException
on Class.forname("com.mysql.jdbc.Driver")
I'm using Windows Vista 64-bit, Eclipse Galileo, GWT framework. I downloaded mysql-connector-java-5.1.6-bin
, but what is the exact path I should put this file in? I'm getting this exception while I'm in gwt-projects, but in normal projects it works good. Any idea how that should be done?
views:
288answers:
3Just put the JAR file in the runtime classpath of the application in question.
In case of a Servlet based webapplication, you normally put it in /WEB-INF/lib
folder. It's by default covered by the webapp's runtime classpath.
Disable Google App Engine. Its a setting in Eclipse.
Google App Engine doesn't allow you to open Sockets. When you try to load the JDBC driver, it makes a socket connection in a static block. An exception in the static block leads to a ClassNotFoundException, which is what you are seeing.
Finally its worked, the problem was not in the classpath, but from the .jar file itself, im using mysql-connector-java-5.1.6-bin which was not working, but when i tried mysql-connector-java-3.0.17-ga-bin everything works good, i hope to fix the new version soon anyway thanks BalusC for helping :)