db2cli.ini type

Use the db2cli.ini type to create configurations that the integration runtime uses to identify the data source location for connecting to an IBM® Db2® database.

Tip: The following combination of configuration types is needed to establish the connection by using Open Database Connectivity (ODBC): 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 runtime
db2cli.ini No /home/aceuser/db2/db2cli.ini 1

About the db2cli.ini file

The db2cli.ini type requires a db2cli.ini file that the 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 runtime. The file is placed in the /home/aceuser/db2 directory of the deployed 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.

  1. Create a text file named db2cli.ini.
  2. 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
  3. Save and close the file.

Creating a configuration for the db2cli.ini type by using the configuration panel

You can create a db2cli.ini-type configuration while creating an integration runtime, or independently, as follows.

  1. Open the Configuration page by clicking the Configuration icon Configuration icon in the navigation pane. Then, click Create configuration. For more information, see Creating configurations on the Configurations page.
  2. From the Create configuration panel, select db2cli.ini from the Type list.
  3. In the Name field, specify a name for this configuration.
  4. In the Description field, specify text that will help you identify the data source location details, or the integration runtime that will use these details to connect to a database.
    Create configuration panel
  5. Complete the db2cli.ini section by completing either of the following steps:
    • Copy the contents of an existing db2cli.ini file and then paste it into the db2cli.ini text editor.
      db2cli.ini text editor with pasted contents
    • Import a valid db2cli.ini file from your file system:
      1. Click the Import db2cli file icon Import icon.
      2. Click within the boxed area to select the file from a file browser, or drag-and-drop the file.
        Import db2cli.ini view

        The content of the db2cli.ini file is displayed.

        db2cli.ini text editor with imported contents
  6. Click Create. The configuration is added to the configurations table and can be selected for use with an integration runtime.

Updating or deleting a configuration

If you need to update the content or settings in a configuration, or delete a configuration that's no longer needed, see Creating configurations on the Configurations page.