0

I have tried to connect to a DB2 DB using the command line:

schemacrawler --server=db2 --host=*myhost* --port=*myport* --database=*db2database* --user=*myuser* --password=*mypassword* --info-level=minimum --command=list --log-level=CONFIG

I get the following error:

SchemaCrawler 16.11.7

Error: Could not connect to jdbc:db2://pathtodb:retrieveMessagesFromServerOnGetMessage=true;, for user 'user', with properties {}: [jcc][t4][2043][11550][4.28.11] Exception java.net.ConnectException: Error opening socket to server myserver on port myport with message: Connection timed out: connect. ERRORCODE=-4499, SQLSTATE=08001

I have the suspicion that there is a problem in the company's firewall that does not let me connect from SchemaCrawler. I can connect to the db with DBeaver from a virtual machine (Saas). Since DBeaver is running SaaS I do not have access to the VM and cannot test from there.

How could I check if the network is blocking SchemaCrawler requests from my local machine (Windows 10 Enterprise 1909)?

  • Please EDIT your question to specify the operating-system details on which schemacrawler is running, and also state if you run schemacrawler on the same VM as Dbeaver (pointing to the same hostname/IP-address/port as DBBeaver) if it then works. – mao Feb 15 '21 at 09:02
  • I added the info, hope it helps. – German Chacon Feb 15 '21 at 09:52

1 Answers1

0

Windows-10 includes ping and tracert and nslookup tools (you run these in a CMD window). These ping and tracert may help you determine if there is IP-level connectivity between your Win10 box and the target Db2-server. Refer to any good textbook to learn how to use these tools.

Windows-10 also has its own software-firewall ( run from the start box if you search firewall) which needs you to add a rule to open the relevant port for tcp and udp traffic. Your login may need to have suitable permissions to make changes like this, so in some corporate environments access is restricted. If this is the case, open a ticket with relevant support teams, as that is not a matter for StackOverflow.

If adding such a rule does not fix your symptom, then you should contact the network support people in your company to open the relevant ports or provide another means for you to achieve the goal.

Note also that there are other tools (arguably better tools) to get a DDL report for a Db2 database, including the db2look utility which is present in the Db2 fat client, and also present on Db2-LUW servers. If the Db2-server runs on either i-series or Z/OS then other tools exist for those environments so talk with the relevant administrators.

mao
  • 11,321
  • 2
  • 13
  • 29