0

I have written a java program to connect to AS400 DB. I am using jt400-6.4.jar to connect to DB.

DB Properties I am using:

as400_dbUrl=jdbc:as400://host/schema;translate binary=true
as400_dbUser=user
as400_dbPassword=pass

My program is not able to connect to DB server i am getting the below error.

2017-06-30 05:36:53 ERROR DBUtil:88 - Exception:
java.sql.SQLException: The application requester cannot establish the connection. (A remote host refused an attempted connect operation.)
        at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
        at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3130)
        at com.ibm.as400.access.AS400JDBCDriver.prepareConnection(AS400JDBCDriver.java:1360)
        at com.ibm.as400.access.AS400JDBCDriver.initializeConnection(AS400JDBCDriver.java:1211)
        at com.ibm.as400.access.AS400JDBCDriver.connect(AS400JDBCDriver.java:352)
        at java.sql.DriverManager.getConnection(DriverManager.java:426)
        at java.sql.DriverManager.getConnection(DriverManager.java:474)

I googled about this, not able to find the exact reason.

I think jt400.jar will use 8471 as the port to connect to DB. Please correct me if I am wrong regarding this port.

I am not able to ping the host. ping host is not returning any response.

I am able to telnet like telnet host. But I am not able to telnet the system like telnet host 8471

Your hlep will be highly appreciable. Kindly help.

Abdul
  • 1,130
  • 4
  • 29
  • 65

1 Answers1

-1

try updating your DB property as:

Add <:port-number> after host

as400_dbUrl=jdbc:as400://host:port/schema;translate binary=true

Hope this solves your problem.

Nidhi257
  • 754
  • 1
  • 5
  • 23
  • Do you know that whether we can mention port while using jt400.jar? https://stackoverflow.com/questions/31128932/setting-jt400-to-connect-to-ibm-i-as400-using-port-23 – Abdul Jul 18 '17 at 12:36