f



as400 driver #2

Hi.

Does the com.ibm.as400.access.AS400JDBCDriver driver that is part of
JTOpen (http://jt400.sourceforge.net) works with db2 udb version 7 that
is installed on windows 2000?
I' m trying to access db2 from java aplication like this:

Class.forName("com.ibm.as400.access.AS400JDBCDriver");
Connection connection =
DriverManager.getConnection("jdbc:as400://hostname","user","password");
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("select * from
tablename");

, and I get this
java.sql.SQLException: The application requester cannot establish the
connection. (Connection refused: connect)
	at
com.ibm.as400.access.JDError.throwSQLException(JDError.java:521)
	at
com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:2797)
	at
com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:1212)
	at
com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:1103)
	at
com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:355)
	at java.sql.DriverManager.getConnection(Unknown
Source)
	at java.sql.DriverManager.getonnection(Unknown
Source)
	at test.DB2Test.main(DB2Test.java:16)

What is the problem?
DB2 is working OK because i accessed it with another driver.
Thanx,
Alan.

0
alan_sec
9/29/2005 2:02:42 PM
comp.databases.ibm-db2 12448 articles. 3 followers. arunrocks (9) is leader. Post Follow

3 Replies
441 Views

Similar Articles

[PageSpeed] 12

alan_sec wrote:

":" + strDB_Port

6790

> Does the com.ibm.as400.access.AS400JDBCDriver driver that is part of
> JTOpen (http://jt400.sourceforge.net) works with db2 udb version 7 that=

> is installed on windows 2000?

I have no idea but this ...

> java.sql.SQLException: The application requester cannot establish the
> connection. (Connection refused: connect)

=2E.. sounds if your driver doesn't connect to the right port. The defaul=
t=20
port for the DB2JD process (at least under eCS) is 6790 so=20
"jdbc:as400://hostname:6790" will solve your problems.

Let me hear if it helps.

Bernd

--=20
"Ja, alles meine Herren" sprach F=FCrst Lichnowsky. "Ooch det roochen?"=20
"Ja, auch das Rauchen." "Ooch im Tiergarten?" "Ja, auch im Tiergarten=20
darf geraucht werden, meine Herren." Und so endeten die Barrikadenk=E4mpf=
e=20
des 18. M=E4rz in Berlin
0
Bernd
9/29/2005 9:25:25 PM
It doesn't help. I tryed with db2java driver that was shiped with db2
udb and it works fine, but i need to test it with as400 driver.
Thanx for repying. 
Alan

0
alan_sec
9/30/2005 6:44:52 AM
alan_sec wrote:

> It doesn't help. I tryed with db2java driver that was shiped with db2
> udb and it works fine, but i need to test it with as400 driver.

In this case I'm out of ideas, unfortunately.

Bernd
0
Bernd
9/30/2005 8:08:50 AM
Reply: