-1

So I'm new to db2 and have to use it in a project soon, in order to prepare myself I used a db2express-c docker image.

From a soon to be co-worker I received the JT400 library to connect from my application to the docker container.

However I keep getting read timeouts when trying to connect to the db2 instance.
My jdbc-url looks like this jdbc:as400://127.0.0.1:50000;database name=TRFM;naming=system;thread used=false;errors=full;toolbox trace=all;trace=true;

After connecting to the db2 instance jdbc sends out some random bytes it seems, but it doesn't get a response back.
Below you'll find some extra information from the trace: 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

mao
  • 11,321
  • 2
  • 13
  • 29
J.Pip
  • 4,523
  • 7
  • 31
  • 49
  • You are mixing up connection string for DB2 for i (IBM i & jt400) with connection string DB2 for LUW. jt400 is for connecting to DB2 running on IBM i. db2jcc4.jar is for connecting to DB2 LUW. Docker image in your link uses DB2 LUW. – Satya Aug 09 '18 at 15:30

1 Answers1

2

You cannot use the JT400 library to talk to a Db2-for-Linux/Unix/Windows server. Instead, that driver is for communicating with Db2-for-i-Series.

To work with Db2 for Linux/Unix/Windows, use one of the Db2 for LUW clients, available for download from http://www-01.ibm.com/support/docview.wss?uid=swg21363866 (IBM registration required).

The Db2-express server in the docker container is Db2 for LUW. Remember that when you use Db2 for LUW, your URL must follow the pattern for Db2 for LUW as described in the Db2 for LUW Knowledge Centre.

mao
  • 11,321
  • 2
  • 13
  • 29
  • thank you for answering, like I said I'm just discovering the whole DB2 ecosystem, so thanks a lot for helping me out! – J.Pip Aug 10 '18 at 07:48