WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Accessing databases from message flows

Create and configure message flows to access user databases.

Before you start:
Complete the following tasks:
Read the following concept topic:
Check which databases are supported on which platform, and if any restrictions apply:
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.

If you want the actions that the message flow takes against the database to be coordinated with other actions, configure the message flow to support global coordination of transactions. For information about how to complete this task, see Configuring transactionality for message flows.

To access a database from a message flow:

  1. Identify the database that you want to access. You can access an existing database, or create a new database for this purpose. See Data sources on z/OS for more information about what to call a z/OS® user database.

    Create the database you want, or ask your database administrator to create it for you. If you are using DB2® or Oracle databases, some of the samples programs include basic instructions for creating databases, which you can use as a guide. For information about which samples include databases, see Creating the user databases.

  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.

      For more information, see Enabling JDBC connections to the databases.

    • 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.

      For more information, see Enabling ODBC connections to the databases.

  3. Authorize the broker to access the database.

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

    • Linux platformUNIX platformWindows platformUse the mqsisetdbparms command to specify a user ID and password for a specific database, or to set up a default user ID and password.
    • z/OS platformUse the BIPSDBP JCL in the customization data set <hlq>.SBIPPROC to customize the mqsisetdbparms command to specify a user ID and password for a specific database, or to set up a default user ID and password.
    • To check existing accesses, use the mqsireportdbparms command.
The following samples access databases from message flows: Message Routing and Data Warehouse use Compute nodes to access the database. Error Handler uses Database nodes to access the database, and Airline Reservations uses both Compute and Database nodes.

You can view information about samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit or the online information center. You can run samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit.

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:45:59


Task topicTask topic | Version 8.0.0.7 | ac00405_