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 DB2 :No suitable driver Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "DB2 :No suitable driver " Watch "DB2 :No suitable driver " New topic
Author

DB2 :No suitable driver

arunij katiliyar
Greenhorn

Joined: Mar 09, 2005
Posts: 26
Hi ,
I am running a simple jdbc program and encountered this problem .

java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:537)
at java.sql.DriverManager.getConnection(DriverManager.java:177)

The DB2 driver is in the classpath . The exception is thrown when trying to get the connection . I know that the driver is not able to load the native libraries . I have all the native libraries in c:\programfiles\SQLLIB\bin .I still wonder whats causing the problem . The following is the code snippet.


Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();


System.out.println("class loaded !!!");

Connection conn = DriverManager.getConnection("jdbc b2://dbahost:50000/citidata,user=javaprod,password=produser");
System.out.println("connected ");

Thanks
Arun
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

Hi
Working with DB2 driver need that you should have license file in the path too.
you should put the : db2jcc_license_cu.jar in class path too.
another thing : AFAIK we should seperate the name value pair with ;
i see that you seperate them with ,
correct them and if you could not connect then post the error messege here.



wish you success.


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
arunij katiliyar
Greenhorn

Joined: Mar 09, 2005
Posts: 26
hi Masoud ,
Thanks for the reply . I am not using jcc driver so i dont need the license jar .

Thanks
Arun
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: DB2 :No suitable driver
 
Similar Threads
db2 java.sql.SQLException: No suitable driver
java.sql.SQLException: No suitable driver
Java-DB2
java.sql.SQLException: No suitable driver
Problem in JDBC connection in Websphere 3.5.0