You can query the database manager configuration parameters through db2getdbmcfg, and you can find the port number or port name. If the port name is found, the corresponding relationship can be found through the network service configuration file.