File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes mysql-jdbc connection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "mysql-jdbc connection problem" Watch "mysql-jdbc connection problem" New topic

mysql-jdbc connection problem

jered veld

Joined: Sep 26, 2002
Posts: 6
i have installed mysql i am running win2000pro.
i am trying to make a small applet to connect to a database named people; so far i havent gotten much success.
the problem is with the driver.
i downloaded the .jar file mm.mysql-2.0.14
i placed this file in the following directory:
i then set my classpath to this in a DOS prompt:
set classpath=.;c:\mysql\mm.mysql-2.0.14.jar;%classpath%
here is the code so far:
import java.sql.*;
public class Lookup{
public static void main(String[] args) throws SQLException, ClassNotFoundException{
String url = "jdbc:mysql://localhost/people";
String user = "";
String password = "";

Connection c = DriverManager.getConnection(url,user,password);
it will compile with no errors. when i run
java Lookup it gives me the error:
exeption in thread "main" java.lang.ClassNotFoundException
thanks in advance for any help.

java newbie
Hartmut Ludwig
Ranch Hand

Joined: Aug 31, 2002
Posts: 51
I guess your problem is that you did not put the binary jarfile of your MM MySQL Driver to the classpath. You used the the source-jar instead. The binary must be named something like:
If you only have this source jarfile you could compile it and add the resulting jar to your classpath.
You can also download the latest Driver-package from here.
The zipfile contains the binary jar called:
I agree. Here's the link:
subject: mysql-jdbc connection problem
It's not a secret anymore!