Format of database URLs

The format of a database URL is determined by whether you are connecting from a client or on the database server.

For connections from a client, use the following format:
Read syntax diagramSkip visual syntax diagram
>>-jdbc:informix-sqli://-hostname:portnum--/database_name:------>

>--+--------------------------------+--------------------------->
   '-USER=userid;-PASSWORD=password-'   

>--+----------------------------+------------------------------->
   '-INFORMIXSERVER=servername;-'   

>--+-----------------------------------------------------------+-><
   |                                           .-;-----------. |   
   |                                           V             | |   
   '-CSM=(SSO=database_server@realm,ENC=true)}---;name=value-+-'   

For connections on the database server, use the following format:
Read syntax diagramSkip visual syntax diagram
                                                                             .-;---------------.   
                                                                             V                 |   
>>-jdbc:informix-direct://database_name:;-+--------------------------------+---+-------------+-+-><
                                          '-user=userid;-password=password-'   '-;name=value-'     

hostname
This required parameter specifies the host name of the computer that is running the Informix® database server.
This parameter is required for client-side JDBC, unless the SQLH_TYPE property is defined or the IFXHOST property is used. This parameter is optional for server-side JDBC.
portnum
This required parameter specifies the port number of the Informix database server. The value of the port number and server name is listed in the /etc/services file.
This parameter is required for client-side JDBC unless the SQLH_TYPE property is defined. This parameter is optional for server-side JDBC.
database_name
This required parameter specifies the name of the Informix database to connect to. If you do not specify the name of a database, a connection is made to the Informix database server.
This parameter is not required except for connections from web applications running in the database server.
INFORMIXSERVER=servername
This optional parameter specifies the name of the database server to connect to. For example, INFORMIXSERVER=lo_informix1210. This parameter is required for 12.10.xC3 and earlier, otherwise this parameter is optional.
USER=userid
This optional parameter specifies the user ID that is used in connections to the Informix database server.
This parameter is optional, however, if you specify userid then you must also specify the PASSWORD. If you do not specify the USER and PASSWORD, the driver calls System.getProperty() to obtain the name of the user currently running the application, and the client is assumed to be trusted.
For SSO, you must specify the user and password or the CSM setting.
PASSWORD=password
This optional parameter specifies the password for the specified user ID.
This parameter is optional, however, if you specify password then you must also specify the USER. If you do not specify the USER and PASSWORD, the driver calls System.getProperty() to obtain the name of the user currently running the application, and the client is assumed to be trusted.
SSO=database_server@realm
This required parameter specifies the service principle for (SSO) access control. For more information, see Using single sign-on access control with the Informix JDBC Driver.
name=value
This optional parameter specifies the name-value pair that specifies a value for the Informix environment variable that is contained in the name variable, which is recognized by either or by Informix database servers. The name variable is not case-sensitive.
For more information, see Specify properties and Informix environment variables with the.

If an LDAP server or sqlhosts file provides the IP address, host name, or port number through the SQLH_TYPE property, you do not have to specify them in the database URL. For more information, see Dynamically reading the Informix sqlhosts file.

In the following example, the connection syntax for a client-side connection is shown:
jdbc:informix-sqli://123.45.67.89:1533/testDB:
   INFORMIXSERVER=myserver;user=rdtest;password=test
In the following example, the connection syntax for a database server connection is shown:
jdbc:informix-direct://testDB;user=rdtest;password=test

Copyright© 2020 HCL Technologies Limited