File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Urgent: Driver class loaded but getting no suitable driver found exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Urgent: Driver class loaded but getting no suitable driver found exception" Watch "Urgent: Driver class loaded but getting no suitable driver found exception" New topic
Author

Urgent: Driver class loaded but getting no suitable driver found exception

Sunil Aggarwal
Greenhorn

Joined: Aug 26, 2004
Posts: 14
Hi All,

I am using "com.ibm.db2j.jdbc.DB2jXADataSource" driver class to connect to a Cloudscape database.

While the driver class gets successfully loaded, i get the following exception when DriverManager.getConnection(url):

java.sql.SQLException: No suitable driver
java.sql.DriverManager.getConnection(DriverManager.java:559)
java.sql.DriverManager.getConnection(DriverManager.java:211)
*********************

The url I specify is: jdbc erby atabaseName.

Can someone please help me with this urgently. Is this exception due to wrong URL but then shouldnt error message be for eg. connection failed etc?

Thank you.

Regards,
Sunil.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Is this exception due to wrong URL but then shouldnt error message be for eg. connection failed etc?

Probably. The DriverManager looks for a driver which can support the URL you give it. If the URL is wrong, its not going to be able to find a driver.

Also "com.ibm.db2j.jdbc.DB2jXADataSource" looks like an XA DataSource, not a driver. Are you sure you are using the right class? The DB2jXADataSource will still need a Driver (which you get from DB2.jar)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent: Driver class loaded but getting no suitable driver found exception