A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
An exception with Connection
Joined: Aug 01, 2005
Mar 06, 2013 09:43:06
My code in Widows is:
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"); Connection conn = DriverManager.getConnection("sluggo", "xxx", "xxx");
In the ODBC screen I can connect to the data base, but in Java I am getting the exception "java.sql.SQLException: No suitable driver found for sluggo".
Your help will be greatly appreciated,
Joined: Apr 04, 2006
Mar 06, 2013 10:42:40
url seems incorrect - it should be of the format - jdbc:db2://<host>[:<port>]/<database_name> Also, please ensure that the DB2 driver jar files are in the classpath.
Tushar (SCJP 1.5)
I agree. Here's the link:
subject: An exception with Connection
Problem with database connection to ingres
mySQL via EJB in reference implementation
error with database connection
Problem with wrapping a method in try/catch block
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013