When performing the Test Connect from the ODBC Data Source Administrator I receive the following warning: [IBM ( DataDirect OEM)][ODBC DB2 Wire Protocol driver] Connection refused. Verify Host Name and Port Number.
Diagnosing The Problem
- Verify the Host Name and Port Number:
- To determine the port number:
- The port number which you have to specify is the one of your DB2 DRDA listener on your AS400 (by default port 446). This may or may not be started yet. To check if your DRDA listener has been started, is active, and that you have specified the correct port number:
- Log on to your AS400
- Type netstat
- Select option 3 - "work with tcp/ip connection status"
- In the local port column you will find 'drda' if the DRDA listener has been started successfully. Choose PF14 to find out the port number on which it listens.
- If DRDA is not currently listening, the AS/400 command "CHGDDMTCPA AUTOSTART(*YES) PWDRQD(*YES)" will start the listener.
- Open up a command (DOS) window and type: telnet ip 446
- If it is successful it will bring you to a blank screen. To get out of the blank screen use ctrl + ] to escape. this will then leave you at a "telnet>" prompt where you type quit.
- If it is not successful you will receive an error. For example: "Could not open connection to the host, on port 446: Connect failed.", this indicates that the connection is blocked, most likely by a firewall. If you are not able to connect to it via telnet then you need to work with your System Administrator or Network Administrator to resolve it.
Resolving The Problem
In this case the port was blocked. After allowing access through the firewall for the port the Test Connection was successful.
16 June 2018