Java Database Connectivity (JDBC)

Hi All

I am facing a problem when a Java program is connected to the MySQL database .My Java program gives an Exception as : ClassNotFoundException

Exception :org.gjt.mm.mysql.Driver

java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass (Launcher.java:268)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:164)

at Files.main(Files.java:352)

Please help me

Thanx and Regards

Lalit Gupta

[932 byte] By [Lalit107a] at [2007-11-26 22:38:57]
# 1
mysql jdbc library jar file isn't in your $CLASSPATH?
Sean.Hoa at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...
# 2
CLASSPATH, CLASSPATH, CLASSPATHClassNotFound is always CLASSPATH (or possibly a typo when using something like Class.forName).Also, you should not be using that Driver. It is the old Driver and is only there for backwards compatability. You should be using
masijade.a at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...
# 3
Better off to forget abaout this very old driver.Download the new one at http://dev.mysql.com/downloads/connector/odbc/3.51.html ...Many support over there.Good luck.
dimitryousa at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...
# 4

> Better off to forget abaout this very old driver.

>

> Download the new one at

> http://dev.mysql.com/downloads/connector/odbc/3.51.htm

> l ...

>

> Many support over there.

>

> Good luck.

That Driver class is found in every driver jarfile (even the most recent) for MySQL. You just simply, should not use it. It is still delivered for backwards compatability however.

masijade.a at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...
# 5
Fine for me.Read the book again to set your CLASSPATH ...
dimitryousa at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...
# 6
As mentionnned above:"Also, you should not be using that Driver. It is the old Driver and is only there for backwards compatability. You should be using com.mysql.jdbc.Driver" ...Right for us, not for you?
dimitryousa at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...
# 7
hi just put the mysql driver jar files into ur lib directory of ur context...
sundar82a at 2007-7-10 11:51:26 > top of Java-index,Database Connectivity,Consumer and Commerce...