Finding the Informix Dynamic Server Port Number on Linux


This tip provides information to help determine the Linux port number to use for Informix Dynamic Server when integrating with WebSphere.


For a Java developer using WebSphere Studio Application Developer, one of the most important things to know is how to connect to the database server that interacts with the application. Typically, you should contact the database administrator and get all the necessary information, such as:

1. Host name
2. IDS server (instance) name
3. Database name
4. TCP/IP port number
5. User name and password with the necessary privileges

Most of this information has to be given by the database administrator, but you may be able to find some of the information yourself. In this section we show how to find the port number configured for an IDS server instance.

Steps to find the port number

1. Log into the Linux server with the user ID that was given by the database administrator (in our case, itso).

2. Open the sqlhosts file. You have to know the location of this file since it can be in any directory, using the INFORMIXSQLHOSTS environment variable. You must ask your database administrator if this variable is set. If so, get the value stored and open the file:


If INFORMIXSQLHOSTS is not configured the server uses the default file, so open it up using vi:

    # vi $INFORMIXDIR/etc/sqlhosts

3. Locate the correspondent entry of the instance name. The instance name is stored in the first column of the entry and the service name (port number) is stored on the forth column. In this case we have demo_on as the server name and demo_on_tcp as the service name.

Locate the correspondent entry of the instance name

4. Now that we know the service name we need to find out the TCP/IP port assigned to it. To do that open the /etc/services file.

    # vi /etc/services

5. Search for service demo_on_tcp in the /etc/services file and find the port number. In our case the port 1533 is assigned to demo_on_tcp. Here are the port number and service name that have to be used in your application.

Search for service demo_on_tcp in the /etc/services file

Special Notices

This material has not been submitted to any formal IBM test and is published AS IS. It has not been the subject of rigorous review. IBM assumes no responsibility for its accuracy or completeness. The use of this information or the implementation of any of these techniques is a client responsibility and depends upon the client's ability to evaluate and integrate them into the client's operational environment.


Publish Date
27 June 2003

Last Update
29 December 2006

(based on 5 reviews)


IBM Form Number