# JDBC - MySQL ??

I tried serveral ways to make it work; however
I can't.

Actually, my problem is i don't know where
i have to set for CLASSPATH.

I also tried for the second way, putting jar file
into jre/lib/ext, but i think it might have
some change in 'String driverName = "org.gjt.mm.mysql.Driver"' but i don't know what it
have to be !!!!

###### Who is Participating?

Commented:
code to access the driver:
Class.forName("org.gjt.mm.mysql.Driver");

Connection conn = DriverManager.getConnection("jdbc:mysql://SERVER1:3306/DB", "UN", "PW");

to set the classpath in windows:
C:\> set CLASSPATH=\path\to\mm.mysql.jdbc-[version];%CLASSPATH%
to set the classpath in unix:
$setenv CLASSPATH /path/to/mm.mysql.jdbc-[version]:$CLASSPATH

HTH,
CJ
0

Author Commented:
Well...i think i found the problem...
I went to DOS mode to set the CLASSPATH.
then i exit which means - I thought - the CLASSPATH
is also deleted...

So what i have to do ???
0

Commented:
yes.. you would have to set the classpath for each dos window.

Or you can set it as an environment variable:
In WinNT/Win2k:
In Win9x:

CJ
0

Author Commented:
Well, let's me try tomorrow.. today i so tried
0

Commented:
ok.. post an update when you try it out.

CJ
0

Author Commented:
I put the unjar all files at c:\mm.mysql,
then i set the CLASSPATH=c:\mm.mysql.

And
String driverName = "org.gjt.mm.mysql.Driver";
Class.forName(driverName);

it still doesn't work... what i did wrong ????

0

Commented:
Here is a silly question, but have to make sure, did you un-jar the jar file that you downloaded?  Make sure that you have extracted the proper jar from within the original jar, then you could place it into the lib/ext directory.  I've done that on a W98 and W2000 machine without any problems, never needed to set the path.  Ok, I see that you did un-jar the files, then copy the bin jar named: mm.mysql-2.0.14-bin.jar and place it into the lib/ext directory.
0

Author Commented:
Well, it works right now....

I will give the point to cheekycj; sorry to tombshell...

Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.