aspose file tools*
The moose likes JDBC and the fly likes What is this No Suitable Driver exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "What is this No Suitable Driver exception? " Watch "What is this No Suitable Driver exception? " New topic
Author

What is this No Suitable Driver exception?

Ja vardhan
Ranch Hand

Joined: May 09, 2005
Posts: 169
Hi,

When I am using the code:

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

getting No Suitable Driver SQL Exception.

When I am using other driver:

Class.forName("oracle.jdbc.driver.OracleDriver");

getting the exception java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver.

I am writing just simple program trying to connect to Oracle database.
But I am gettign exception with Class.forName() method as specified above.

What might be the problem?
We need to have installed any driver on our machine when we are using connection driver?
What are the basic requirements when we are writing JDBC program?

Please post your ideas.

Thanks.


Javardhan:
Emanuel Kadziela
Ranch Hand

Joined: Mar 24, 2005
Posts: 186
You certainly need at least a jar in your classpath with the driver classes in it.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41874
    
  63
In the case of the Oracle driver, you're missing the class in your classpath, as was suggested before. In the case of the JDBC/ODBC bridge, it sounds like the URL you're using to access the DB is incorrect.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is this No Suitable Driver exception?