• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

DB2 :No suitable driver

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
arunij katiliyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Masoud ,
Thanks for the reply . I am not using jcc driver so i dont need the license jar .

Thanks
Arun
 
It's never done THAT before. Explain it to me tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic