Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

my sql connectivity

0 views
Skip to first unread message

focode

unread,
Apr 29, 2008, 4:00:29 PM4/29/08
to
i have downloaded "mysql-connector-java-5.1.6.tar" and the related
connecter for java and set the class path , my programa compiled well
but it reported error class not found exception then preceded
by ...................

"java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)"

i want to learn the connectivity with mysql , can any one suggest a
simple tutorial

thanks

Leonard Milcin

unread,
Apr 29, 2008, 6:25:23 PM4/29/08
to

You don't have the *jar* file in the classpath. Your program will compile
well without the driver because it's loaded by name.

Best regards,
Leonard

--
Simplicity is the ultimate sophistication.
-- Leonardo da Vinci

Lew

unread,
Apr 29, 2008, 9:37:10 PM4/29/08
to
focode wrote:
>> i [sic] have downloaded "mysql-connector-java-5.1.6.tar" and the related
>> connecter for java [sic] and set the class path , my programa compiled well

>> but it reported error class not found exception then preceded

In general you'll do better if you copy-and-paste compiler errors and
exception messages and the like literally, although in this case the message
is clear enough to relax the advice a tad.

Leonard Milcin wrote:
> You don't have the *jar* file in the classpath. Your program will compile
> well without the driver because it's loaded by name.

For how to set the classpath:
<http://java.sun.com/javase/6/docs/technotes/tools/solaris/classpath.html>

--
Lew

0 new messages