If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysqlconnector/j

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-10-03, 05:14
maite maite is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
mysqlconnector/j

Hi,

I am new to the usage of mysql with java. I have the following problem when I am trying connect to the server from java. My code looks like the following:

try{
Class.forName("com.mysql.jdbc.Driver").newInstance ();
Connection conn= DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&password=xxx");

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

The .jar file is added in autoexec.bat (mysql-connector-java-3.0.8-stable-bin.jar).
Everything compiles but when I try to execute I get this:

SQLException: com.mysql.jdbc.Driver

I don't know where is the problem. Any help?????? It's very important. Thank you,
Maite
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On