Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

my sql connectivity

Thread view: 
focode - 29 Apr 2008 21:00 GMT
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 - 29 Apr 2008 22:25 GMT
> 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
[quoted text clipped - 16 lines]
>
> thanks

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

Signature

Simplicity is the ultimate sophistication.
                                 -- Leonardo da Vinci

Lew - 30 Apr 2008 02:37 GMT
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.

> 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>

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.