This is tipical problem when the client cannot reach the database. There could be different reasons:
- Closed port in the local (client) machine. (firewall outbound)
- If using local catalog, check if everything is correct (db2 catalog database, db2 catalog tcpip node). If using direct connection skip this step.
- Routing problem (iptables ou network firewall)
- Database server with closed port (inbonud) - netstat -nato check port.
- Instance down (ps -ef or task center in windows)
- DB2COMM registry variable is not set to tcpip
- Port number is not correctly mapped to service name (instance configuration, use number instead)
- Database name is not correct (connect locally in the database server)
You can do a telnet from the Windows (client) machine to the server via telnet
telnet databaseServerIP portNumber
Even, if the db2 server is in the same machine, you can do a localhost telnet in order to see that the instance can receive TCP connections
telnet localhost 50000
Once you can do that successfully, you can connect to the database.