

db2cli.ini type
Use the db2cli.ini
type to create configurations that
the integration server or integration runtime uses to identify the data source location
for connecting to an IBM® Db2® database.
db2cli.ini
, odbc.ini
, and setdbparms.txt
.Summary of key details for the configuration type
File name or type | Contains secrets | Path extracted/imported to | Maximum allowed per integration server or integration runtime |
---|---|---|---|
db2cli.ini | No | /home/aceuser/db2/db2cli.ini | 1 |
Creating the file for a configuration object of type db2cli.ini
The db2cli.ini
type requires a db2cli.ini file that the integration server or integration runtime can use. In IBM Db2, db2cli.ini is used as an initialization file, which
contains a set of keywords and values that you can use to configure the behavior of the CLI/ODBC
driver and CLI/ODBC applications. In IBM App Connect, you can use a
subset of these keywords to specify data source location details for connecting to your IBM Db2 database. Although a db2cli.ini file can
contain secrets such as credentials or certificate details, the file that you use to create your
configuration object is not intended to store secrets. Therefore, you must separately define the
database authentication credentials by creating a configuration object of type
setdbparms.txt
. For more information,
see db2cli.ini initialization file in the IBM Db2 documentation.
Only one db2cli.ini file can be specified per integration server or integration runtime. The file is placed in the /home/aceuser/db2 directory of the deployed integration server or integration runtime. A DB2CLIINIPATH environment variable is automatically set to the /home/aceuser/db2 path where the db2cli.ini file is mounted.
To specify a data source location in a db2cli.ini file for connecting to an IBM Db2 database, complete the following steps.
- Create a text file named db2cli.ini.
- To complete the file, add a
[Data Source]
stanza (or section) for each IBM Db2 database that you want to connect to. Each data source stanza starts with the name of a unique database alias between brackets, [ ], followed by keyword/value pairs that define the data source location details, where:- databaseAlias is the symbolic name for a data structure that contains connection details about a specific database.
- databaseName is the database name on the server.
- hostName_or_IPaddress is the hostname or IP address of the database server.
- serviceName_or_portNumber is the database server's service name or the port
number of the database server listener.Tip: For IBM Db2 on IBM Cloud, you can view the database details from the
Service credentials
view of your IBM Db2 on IBM Cloud service in your IBM Cloud dashboard.
; Comment lines start with a semi-colon. [databaseAlias] Database=databaseName Protocol=TCPIP Hostname=hostName_or_IPaddress Port=serviceName_or_portNumber
The following example shows the db2cli.ini contents for connecting to database USERDB running on host dashdb-abc-sbox-yz-dal09-03.services.dal.bluemix.net with opened port 30120:
[USERDB] Database=USERDB Protocol=TCPIP Hostname=dashdb-abc-sbox-yz-dal09-03.services.dal.bluemix.net Port=30120
- Save and close the file.
After you create the file, you can use it to create a configuration object as described in Configuration reference: Creating an instance from the Red Hat OpenShift web console and Creating an instance from the Red Hat OpenShift or Kubernetes CLI.
For an example of how to use this configuration type, see Connecting IBM App Connect to databases by using Open Database Connectivity (ODBC) and Connecting IBM App Connect to an IBM Db2 database in a private network.