Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sunil Aggarwal
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic