try changing to the newest 3.0.8 driver of mysql.
-----Original Message-----
From: Luong Phan [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 10:31 AM
To: [EMAIL PROTECTED]
Subject: Suitable Driver Error
Hi all,
In my web application, I use mysql supported by Redhat Linux 7.3 to
store database, jakarta-tomcat-3.2.4,
mysql-connector-java-3.0.6-stable-bin.jar, and JSP.
Every time, I run the program:
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class Data {
private Connection connection;
private Statement statement;
public Data() throws ClassNotFoundException,SQLException{
String DBDriver=null;
String url=null;
String username=null;
String password=null;
password="myPassword";
username="myUserName";
url="dbc:mysql://localhost/gmds";
DBDriver="com.mysql.jdbc.Driver";
try{
Class.forName(DBDriver);
connection=DriverManager.getConnection(url,username,password);
statement=connection.createStatement();
}catch(ClassNotFoundException e){
System.err.println("Failed to load JDBC/ODBC
driver.");
e.printStackTrace();
}catch(SQLException e){
System.err.println("Unable to connect");
e.printStackTrace();
}
}
...
I get the error:
Unable to connect
java.sql.SQLException: No suitable driver at
java.sql.DriverManager.getConnection(DriverManager.java 532)
...
What is suitable driver for my application? Please give me some words of
advice!
Thanks a lot.
LuongPhan
---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]