Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "What is this No Suitable Driver exception? " Watch "What is this No Suitable Driver exception? " New topic

What is this No Suitable Driver exception?

Ja vardhan
Ranch Hand

Joined: May 09, 2005
Posts: 169

When I am using the code:


getting No Suitable Driver SQL Exception.

When I am using other driver:


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.


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

Joined: Mar 22, 2005
Posts: 41182
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
Consider Paul's rocket mass heater.
subject: What is this No Suitable Driver exception?
Similar Threads
No suitable driver found for oracle:jdbc:thin:@localhost:1521:xe Exception ;Hibernate
Exception in thread "main" java.sql.SQLException: No suitable driver
Not Suitable Driver Error
Registering the drivers
Setting the attribute