Securing the JDBC Providers policy for the scenario to enrich a message with data from a database

You can secure the JDBC connection to a DB2® database by running the mqsisetdbparms command and associating a security identity with the JDBC Providers policy.

About this task

A DB2 database requires a data source login name and password on all connections.

Procedure

You must secure the JDBC connection to the DB2 database by completing the following steps:

  1. Identify the user ID and password that you want to associate with the JDBC connection.

    Ask your database administrator for the user ID and password. This user ID must have suitable permissions. In this scenario, user ID db2admin is used.

  2. Run the mqsisetdbparms command to associate your user ID and password with the security identity that is associated with the database. In this scenario, the security identity is scenario.
    Run the following command:
    mqsisetdbparms integrationNodeName -n jdbc::scenario -u db2admin -p password
    • The -n parameter specifies the security identity that is used to authenticate the JDBC connection; in this case, scenario.

      The security identity that you define in this step must match exactly what is set in the Security identity property of the JDBC Providers policy. In this scenario, you create a security identity named scenario, so the value that you must specify in the -n parameter is jdbc::scenario.

    • Your user ID (specified by the -u parameter) is db2admin.
    • Your password (specified by the -p parameter) is password.

    As an alternative to using the mqsisetdbparms command, you can configure connections to secured resources by using credentials that are stored in an App Connect Enterprise secure vault. For information about using this method, see Configuring encrypted security credentials.

  3. Check the name of the corresponding Security identity property in the CLIENTS JDBC Providers policy to ensure that it matches the name of the security identity that you defined in step 2.
    For more information about the JDBC Providers policy, see JDBC Providers policy (JDBCProviders). ). For more information about configuring a secure database connection, see Securing database connections. .

Results

You have secured the JDBC connection.

You have completed the scenario.