Microsoft SDK for Java

Q179854 PRB: No Suitable Driver Exception With JDBC Bridge and SDK

The information in this article applies to:

SYMPTOMS

When running your Java class that uses the JDBC bridge with the SDK for Java 2.0 or newer, you see the following exception:

java.sql.SQLException: No suitable driver

CAUSE

One of the frequent causes for this exception is running any application that the JDBC bridge shipped with the SDK for Java 2.0 Beta.

RESOLUTION

In general, the package name has changed to com.ms.jdbc.odbc with Microsoft® Internet Explorer 4.0x and SDK for Java 2.0 or later Microsoft VM. For example the following lines should be changed:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

or

Class.forName("com.ms.sql.CDriver");

to:

Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");

MORE INFORMATION

Other common causes for "No suitable driver" are invalid connection strings, user IDs, passwords, and security restrictions imposed on the driver (if it was downloaded and is not trusted).

REFERENCES

More information on the JDBC driver is included the SDK for Java documentation and the JDBC sample available with the SDK for Java.

For the latest Knowledge Base articles and other support information on Microsoft® Visual J++® and the SDK for Java, please see the following pages on the Microsoft Technical Support site:

http://support.microsoft.com/support/visualj/ This link takes you to a site on microsoft.com

http://support.microsoft.com/support/java/ This link takes you to a site on microsoft.com

© 1999 Microsoft Corporation. All rights reserved. Terms of use.