Accessing databases from message flows

Create and configure message flows to access databases.

Before you begin

Complete the following tasks:
Read the following concept topic:
Check which databases are supported on which platform, and if any restrictions apply:

About this task

You can access a database from a message flow in two ways:
  • You can design a message flow that responds to events generated by the database.
  • After a flow has already started, you can access the database to read or update information in it. Information from the database can be used to enhance or influence the operation of the message flow.

You can access a database from a message flow by using the following nodes:

  • Compute
  • Database
  • DatabaseInput
  • DatabaseRetrieve
  • DatabaseRoute
  • Filter
  • JavaCompute
  • Mapping

For more details about these nodes, and how to configure them in message flows, see Built-in nodes.

To access a database from a message flow:

Procedure

  1. Identify the database that you want to access.
  2. Define a connection to the data source name (DSN) to enable a connection to the database, if one does not exist:
    • Define a JDBC connection if you want to interact with a database directly from a Java™ application, or from a Mapping node. You can code Java in both a JavaCompute node and in a Java user-defined node.
    • Define an ODBC connection if you want to interact with a database in a node that supports ESQL, including a JavaCompute node in which you use the MbSQLStatement interface.
  3. Authorize the integration node to access the database.

    Access to a database from within a message flow is controlled by user ID and password.

    • Linux platformUNIX platformUse the mqsicredentials command to specify a user ID and password for a specific database, or to set up a default user ID and password. Alternatively, you can use the mqsisetdbparms command.
    • Windows platformUse the mqsicredentials command to specify a user ID and password for a specific database, or to set up a default user ID and password. Alternatively, you can use the mqsisetdbparms command. If Windows integrated authentication is being used for SQL Server database access, then the service user ID under which the broker process runs are used by Windows to access the SQL Server database. That is, it ignores any user ID and password credentials that were set using the mqsicredentials command or mqsisetdbparms command.
    • To check existing accesses, use the mqsicredentials command. Alternatively, you can use the mqsisetdbparms command.