Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / September 2005

Tip: Looking for answers? Try searching our database.

as400 driver

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alan_sec - 29 Sep 2005 15:02 GMT
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.
Bernd Hohmann - 29 Sep 2005 22:25 GMT
":" + 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)

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

Let me hear if it helps.

Bernd

Signature

"Ja, alles meine Herren" sprach Fürst Lichnowsky. "Ooch det roochen?"
"Ja, auch das Rauchen." "Ooch im Tiergarten?" "Ja, auch im Tiergarten
darf geraucht werden, meine Herren." Und so endeten die Barrikadenkämpfe
des 18. März in Berlin

alan_sec - 30 Sep 2005 07:44 GMT
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
Bernd Hohmann - 30 Sep 2005 09:08 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.