Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes MySQL Beginner Has Problem With Loading JDBC Driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySQL Beginner Has Problem With Loading JDBC Driver" Watch "MySQL Beginner Has Problem With Loading JDBC Driver" New topic
Author

MySQL Beginner Has Problem With Loading JDBC Driver

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
1. I have installed MySQL (C:\mysql), created a databse (soup), and created a little table (VIDEOS). I am able to see the table in the console:
sql>select * from videos
2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
4. MySQL server is running
C:\> C:\mysql\bin\mysqld-nt --standalone
5. open another DOS window and use the database
mysql>USE SOUP
6. succesfully compiled a Java program (javac Test.java):

7. when I run the Java program (java Test), I got
the message:
could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
What am I missing?
[ March 21, 2003: Message edited by: JiaPei Jen ]
[ March 21, 2003: Message edited by: JiaPei Jen ]
[ March 21, 2003: Message edited by: JiaPei Jen ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Perhaps something is different or wrong with the alpha JConnector driver you're using. What happens when using the stable version 3.0.6?
Also, how are you running the app? From the command line or through an IDE? and which IDE?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

org.gjt.mm.mysql.Driver is for the old mm.MySQL Driver that has now become Connector/J.
Try using com.mysql.jdbc.Driver instead.


GenRocket - Experts at Building Test Data
 
GeeCON Prague 2014
 
subject: MySQL Beginner Has Problem With Loading JDBC Driver