what should i set in class path
Posted by: Jimmy Smith
Date: May 06, 2006 12:36PM

which jar file i need to set in class path ?

i have copy all the folder and file in "mysql-connector-java-3.0.1-beta" to c:\temp

so, can somebody tell me how to set the class path .
i have try to set
C:\temp\mysql-connector-java-3.0.1-beta-bin.jar;
C:\temp\lib\jdbc2_0-stdext.jar;
C:\temp\lib\jta-spec1_0_1.jar;
C:\temp\com\mysql\jdbc\Driver.java;
C:\temp\com\mysql\jdbc\Driver.class;
C:\temp\org\gjt\mm\mysql\Driver.class;
C:\temp\org\gjt\mm\mysql\Driver.java

In JCreator->Configure->Options... i jus simply add all because i don't know which
is correct...

Beside that, do i need to copy all this classpath into environment variables ?

The SQLException i get is "No Suitable Driver"

The following is my coding...
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Jdbc11 {
public static void main(String [] args) {
try {
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306","root", "admin");
Class.forName("com.mysql.jdbc.Driver");

} catch(Exception ex) {
//handle the error
System.out.println("SQLException: " + ex.getMessage());
}
}
}

Any reply and helps would be greatly appreciated.

smithveg

Options: ReplyQuote


Subject
Written By
Posted
what should i set in class path
May 06, 2006 12:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.