Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help--> java.sql.SQLException: No suitable driver

Status
Not open for further replies.

SA23

Programmer
Oct 2, 2001
7
AU
Dear all!

I am trying to write my first java application that makes connection to the database.

I use MS Access database. OS is Win95
In order to establish the connection I load a required driver first:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
As far as I understand if the driver could not be found the error would be thrown here: "Failed to load the driver..."

However, when I am trying to get an instance of the Connection class [
con = DriverManager.getConnection(url, "", ""); ]
the following error is thrown:
java.sql.SQLException: No suitable driver
I have checked the url string. It is "jdbc:eek:dbc:employee" where employee is the datasource name pointing to the MS Access employee.mdb. It is properly set in the Control Panel ODBC Microsoft Access Setup. In the datasource window I have got: employee(Microsoft Access Driver(*.mdb)).

In addition when I tried to run my program on a different computer (WinNT) it worked.

Thank you very much for your time and assistance on this problem.





 
This sounds like a CLASSPATH issue. Check to see if the CLASSPATHs between the two machines are the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top