3 messages in com.mysql.lists.javaClassNotFoundError -- driver of jdbc
FromSent OnAttachments
d395...@est.fib.upc.edu24 Feb 2005 15:11 
Thomas Lundström25 Feb 2005 01:06 
Barend Köbben28 Feb 2005 00:10 
Subject:ClassNotFoundError -- driver of jdbc
From:d395...@est.fib.upc.edu (d395@est.fib.upc.edu)
Date:02/24/2005 03:11:04 PM
List:com.mysql.lists.java

Hi;

I'm using Connector/J, but I'm unable to solve o problem. I hae the following Java code (taken from these web pages):

import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;

public class BD {

public static void main(String args[]) throws Exception {

Connection con = null; try{

Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root&password=pujols");

}

catch(SQLException ex){

System.out.println("SQLException: "+ex.getMessage()); System.out.println("SQLState: "+ex.getSQLState()); System.out.println("VendorError: "+ex.getErrorCode());

} } }

However, when I try to execute this file, I get a message error saying that it's impossible to find the com.mysql.jdbc.Driver (ClassNotFoundException). I have modified the Path of my system to include the jar file I found in the Connector/J Zip (I think I did it correctly...). In case to delete this sentence, I get a SQLException: not suitable driver.

What Am I doing bad? Where is the class I need? I haven't been able to find any solution anywhere.

Thanks for all.

Sergi