spring-boot jdbc 到 db2 的连接读取超时

spring-boot jdbc connection to db2 gets read timeouts

所以我是 db2 的新手,很快就要在项目中使用它,为了做好准备我使用了 db2express-c docker image.

我收到了一个即将成为同事的 JT400 库,用于从我的应用程序连接到 docker 容器。

但是,当我尝试连接到 db2 实例时,我总是遇到读取超时。
我的 jdbc-url 看起来像这样 jdbc:as400://127.0.0.1:50000;database name=TRFM;naming=system;thread used=false;errors=full;toolbox trace=all;trace=true;

连接到 db2 实例后 jdbc 似乎发送了一些随机字节,但没有收到响应。
您会在下面找到来自跟踪的一些额外信息: Thread[restartedMain,5,main] Thu Aug 9 16:47:47:837 CEST 2018 Sending exchange random seeds request... Thread[restartedMain,5,main] Thu Aug 9 16:47:47:838 CEST 2018 Data stream sent (connID=337871951) ... 00 00 00 1C 01 00 E0 04 00 00 00 00 00 00 00 00 00 08 70 01 00 00 01 65 1F 28 6D 7D Thread[restartedMain,5,main] Thu Aug 9 16:47:47:838 CEST 2018 Receiving exchange random seeds reply... Thread[restartedMain,5,main] Thu Aug 9 16:48:07:842 CEST 2018 Establishing connection failed: java.net.SocketTimeoutException: Read timed out

您不能使用 JT400 库与 Db2-for-Linux/Unix/Windows 服务器通信。 相反,该驱动程序用于与 Db2-for-i-Series 通信。

要使用 Db2 for Linux/Unix/Windows,请使用 Db2 for LUW 客户端之一,可从 http://www-01.ibm.com/support/docview.wss?uid=swg21363866 下载(需要 IBM 注册)。

docker 容器中的 Db2-express 服务器是 Db2 for LUW。请记住,当您使用 Db2 for LUW 时,您的 URL 必须遵循 Db2 for LUW 知识中心中所述的 pattern for Db2 for LUW。