Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DB2 and Java

0 views
Skip to first unread message

Santhosh

unread,
Jul 18, 2006, 12:09:49 AM7/18/06
to
Hi All

I could't able to connect to Db2 DB using the java program [type 4
driver.] I received the following error:

Error is No suitable driver
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at DB2DailyCheckListH.processDB(DB2DailyCheckListH.java:78)
at DB2DailyCheckListH.<init>(DB2DailyCheckListH.java:146)
at DB2DailyCheckListH.main(DB2DailyCheckListH.java:197)

The Java program is:

try{
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
Connection connection =
DriverManager.getConnection("jdbc:db2://eapsdev10021:60000/DBAPPASP",userID,passWord);
if (connection != null) {

DBLine = "<TR><td>"+country+"</td><td>"+InstanceName

+"</td><td>"+DBname+"</td><td>"+"OK"+"</td><td>"+"&nbsp"+"</td></tr>";
addFileLine();

connection.close();
}
}

4.s...@mail.ru

unread,
Jul 18, 2006, 1:46:49 AM7/18/06
to
Hello.
For type 4 driver you have to use these jar files:
db2jcc.jar
db2jcc_license_cu.jar (if you connects to DB2 v8 for LUW)
and in your hava code:
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();

Larry Menard

unread,
Jul 18, 2006, 5:04:39 AM7/18/06
to
"COM.ibm.db2.jdbc.app.DB2Driver" is not the Type 4 driver...
"com.ibm.db2.jcc.DB2Driver" is.
0 new messages