2 messages in com.mysql.lists.javaRe: Problem connecting to Mysql datab...
FromSent OnAttachments
Joei Huang30 Sep 2003 23:26 
Eric MacAdie01 Oct 2003 05:49 
Subject:Re: Problem connecting to Mysql database in Sun One Studio 5
From:Eric MacAdie (ek@MacAdie.net)
Date:10/01/2003 05:49:50 AM
List:com.mysql.lists.java

Your jdbc:mysql URL must include the name of the database and the username and password as well.

EKMacAdie

On Wed, 1 Oct 2003, Joei Huang wrote:

Hi im running Sun one Studio 5 and Im trying to get it to connect to my MySQL database.

But whenever I try to run my code the compiler gives me the error "

java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:198) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:186) at java.lang.ClassLoader.loadClass(ClassLoader.java:299) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265) at java.lang.ClassLoader.loadClass(ClassLoader.java:255) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:140) at Database.<init>(Database.java:24) at Database.main(Database.java:295)

To the code [ Class.forName("org.gjt.mm.mysql.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost/"); ]

I made sure I have the file mysql-connector-java-3.0.8-stable-bin.jar in C:\Sun\studio5se\lib\ext\

But Still it gives me the same error. Funny thing is the code works in Forte 4.

Thanks Joei