Solved

JDBC - MySQL ??

Posted on 2002-06-04
8
187 Views
Last Modified: 2010-03-31
I have downloaded mm.mysql 2.0.14 drivers.
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 !!!!

Are there any document about this ?? thank you
0
Comment
Question by:mrvithan
  • 4
  • 3
8 Comments
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 7053980
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 Comment

by:mrvithan
ID: 7054012
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
 
LVL 19

Expert Comment

by:cheekycj
ID: 7054052
yes.. you would have to set the classpath for each dos window.

Or you can set it as an environment variable:
In WinNT/Win2k:
  Under Computer/System Properties-> Environment Variables.. add your classpath.
In Win9x:
   Add it to autoexec.bat.

CJ
0
 

Author Comment

by:mrvithan
ID: 7054073
Well, let's me try tomorrow.. today i so tried
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:cheekycj
ID: 7054330
ok.. post an update when you try it out.

CJ
0
 

Author Comment

by:mrvithan
ID: 7055572
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
 
LVL 7

Expert Comment

by:tomboshell
ID: 7055592
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 Comment

by:mrvithan
ID: 7055648
Well, it works right now....

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

Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java  and programming certification ? 4 86
@SBGen Method 3 38
Java Loop 6 50
Windows 10 IE Certificate Issue 10 42
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now