[英]java.sql.SQLException: The application requester cannot establish the connection
I have written a java program to connect to AS400 DB. 我已经编写了一个Java程序来连接到AS400 DB。 I am using jt400-6.4.jar to connect to DB.
我正在使用jt400-6.4.jar连接到数据库。
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. 我认为jt400.jar将使用8471作为连接数据库的端口。 Please correct me if I am wrong regarding this port.
如果我对此端口有误,请纠正我。
I am not able to ping the host. 我无法ping通主机。
ping host
is not returning any response. ping host
未返回任何响应。
I am able to telnet like telnet host
. 我能够像
telnet host
一样进行telnet host
。 But I am not able to telnet the system like telnet host 8471
但是我无法像
telnet host 8471
一样通过telnet host 8471
系统
Your hlep will be highly appreciable. 您的呼声将非常高。 Kindly help.
请帮助。
try updating your DB property as: 尝试将数据库属性更新为:
Add <:port-number> after host 在主机后添加<:port-number>
as400_dbUrl=jdbc:as400://host:port/schema;translate binary=true as400_dbUrl = jdbc:as400:// host:port / schema;翻译二进制= true
Hope this solves your problem. 希望这能解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.