问题描述
JT400-从Windows机器连接到IBMi机器时,JDBC连接工作正常.
JT400 - The JDBC connection is working fine when connecting to a IBMi machine from windows machine.
DriverManager.registerDriver(new com.ibm.as400.access.AS400JDBCDriver());
String sysname = "xxx.xxx.xx.xxx";
String xref = "IBMISQLLIB";
String url = "jdbc:as400://" + sysname + ";translate binary=true;prompt=false;naming=sql;libraries=" + xref;
Connection connection = DriverManager.getConnection(url, "USERNAME", "PASSWORD");
print("Connection created successfully");
但是无法使用相同的代码创建连接-在同一台IBMi机器上运行代码时(通过"QSH Command Entry"上的可运行jar),错误:
But fails to create the connection by using the same code - when running the code on the same IBMi machine (by a runnable jar on 'QSH Command Entry'), ERROR:
任何想法现在出了什么问题吗?
Any idea what is going wrong now ??
- 因为这在几天前就起作用了
- 相同的代码正在其他IBMi服务器上工作
有关IBMi机器的更多详细信息是:
Some more details about the IBMi machine are:
- 连接配置文件中使用的用户名没有访问权限问题
- 在IBMi机器上未设置防火墙
- 按照说明验证TCP/IP配置-在IBM i上配置TCP/IP
推荐答案
问题与默认的TCP/IP端口有关,该端口未监听JDBC连接请求.
The problem was related to default TCP/IP port, which was not listening the JDBC connection request.
最后,通过重新启动IBMi机器解决了问题.
And finally the problem got resolved by restarting the IBMi machine.
:)
这篇关于JT400-IBMi机器拒绝了JDBC连接,但在Windows机器上可以使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!