|
|
|
|
|
|
| Author |
Message |
Santhosh *nix forums beginner
Joined: 01 Dec 2005
Posts: 17
|
Posted: Tue Jul 18, 2006 4:09 am Post subject:
DB2 and Java
|
|
|
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:7
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>"+" "+"</td></tr>";
addFileLine();
connection.close();
}
} |
|
| Back to top |
|
 |
4.spam@mail.ru *nix forums beginner
Joined: 14 Jul 2005
Posts: 49
|
Posted: Tue Jul 18, 2006 5:46 am Post subject:
Re: DB2 and Java
|
|
|
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();
| Quote: | 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:7
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>"+" "+"</td></tr>";
addFileLine();
connection.close();
}
} |
|
|
| Back to top |
|
 |
Larry Menard *nix forums addict
Joined: 09 Oct 2005
Posts: 58
|
Posted: Tue Jul 18, 2006 9:04 am Post subject:
Re: DB2 and Java
|
|
|
"COM.ibm.db2.jdbc.app.DB2Driver" is not the Type 4 driver...
"com.ibm.db2.jcc.DB2Driver" is.
Santhosh wrote:
| Quote: | 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:7
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>"+" "+"</td></tr>";
addFileLine();
connection.close();
}
} |
|
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Nov 22, 2008 12:19 am | All times are GMT
|
|
Free Ringtones | Sauna | Internet Advertising | Free Ringtones | Download Korean movies
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|