4 Configuring a DB2 CDC Adapter

This chapter provides an example for creating an OracleAS adapter for DB2. To work with an OracleAS adapter for DB2, you must also configure either a BPEL process or a Mediator process. For information on using BPEL or Mediator, see Creating the Project in JDeveloper Examples.

Creating Outbound Interactions with the OracleAS Adapter for DB2

To work with the OracleAS Adapter for DB2 and create outbound interactions, you must create a new DB2 database and use the data to create a CDC Solution.


The following is required to perform the tasks described in this chapter:

  • Computer with Windows operating system

  • Mainframe computer with z/OS operating system

  • Oracle Connect v installed on the Mainframe computer

  • Oracle Studio v installed on the Windows computer.

Adding the DB2 Hospital Data Source

To create an DB2 data source you must do the following:

Prepare the System

In your DB2 database, you should create a database called Hospital. In this database create the following tables and columns as described in Table 4-1.

Table 4-1 DB2 Tables and Columns

Tables Columns



































Set up Machine Access to Oracle Connect

You begin by configuring access to the Windows computer with your DB2 data. You configure this access with Oracle Connect. Open Oracle connect and follow the directions Setting Up the IBM z/OS Platform in Oracle Studio. Enter the following information in the Add machine dialog box:

  • Host name/IP address: Enter the name or IP address for the Mainframe computer with the Hospital database. This should be installed in the same directory as Oracle Connect.

  • Port: Enter the port number where the daemon is running. The default port is 2551.

  • Display name: You do not need to enter any information in this field (By default, the display name is the host name and the port number).

  • User name: If the computer you are accessing needs an administrator password. If so enter the name o f the computer's administrator.

  • Password: If necessary, enter the computer administrator's password.

  • Connect via NAT with fixed IP address: Select this if the machine uses the NAT (Network Address Translation) firewall protocol, with a fixed configuration, mapping each external IP to one internal IP, regardless of the port specified.

Figure 4-1 shows the Add Machine dialog box with the correct information:

Figure 4-1 Add Machine Dialog Box

Machine dialog

Create a Change Data Capture

You now create the change data capture for the tables you created. When you are finished you can create WSDL and binding (jca) files. See Create the JCA Configuration Files for more information.

These files contain the information needed to create the BPEL and Mediator projects in JDeveloper. For more information on using JDeveloper for the BPEL Process Manger and Mediator, see Creating the Project in JDeveloper Examples.

Before you begin to set up your change data capture ensure that the DB2 is set up to handle a change data capture. For information on how this is done see these topics.

The following sections describe how to create a change data capture in Oracle Studio.

Setting up a Change Data Capture

The following procedure describes how to set up your change data capture for this sample. For detailed information on setting up a change data capture for DB2, see Setting up a Change Data Capture in Oracle Studio.

  1. Open the Solution perspective in Oracle Studio.

  2. In the left pane, click Create new project.

  3. Enter the following:

    • Project name: Hospital

    • Type: DB2

    Figure 4-2 shows the correct data in the Create new project screen.

    Figure 4-2 Create New Project

    Create new project
  4. Click Design and then click Next and Finish to use the default values in the screens. If you want to set up your staging area on a UNIX computer, then you must change that setting in the second screen. For more information, see Create a CDC Project.

  5. Click Implement to go to the Implementation guide.

  6. For Server Configuration, enter the following information:

    • Machine: Enter the information for the Windows computer with Oracle Connect installed.

    • Data Source: Enter the following:

      • Location: Enter the DB2 location name for the DB2 instance that you are using for this project. The parameter should be specified if the connected DB2 instance is different than the instance defined in the MVSDEFAULTSSID parameter of the ODBCINI file.

      • Database Name: Enter the name of the Hospital DB2 database that you created for this project.

      For more information, see Set up the Data Source.

    • CDC Service: You can use the default settings, which does not include the capture of before-image records.

    • Logger: Enter the name of the bootsrap dataset you are using to keep track of the DB2 logs.

    • Logging Level: Use the default settings.

  7. For Stream Service Configuration, enter the following information:

    • Machine: Enter the information for the computer you are using as your staging area. This must be a Windows or UNIX machine.

    • Stream Service: Enter the following:

      • In the Staging Area screen, enter a location for the change files on the computer you specified and the Staging Area computer.

      • In the Changed Data Capture Table Selection, select all of the tables.

      • In the remaining screens, click Next to use the default values.

    • Access Service Manager: Click Next in all of the screens to use the default values.

      For more information, see Set up the CDC Service.

You must now Deploy the Solution.

Deploy the Solution

To deploy the solution, click Activate Workspaces. Click OK in any screen that opens. If you get a message about a naming collision, you must resolve this first.

For information on deploying a change data capture, see Deploying a Change Data Capture.

Create the JCA Configuration Files

You must create both a WSDL and JCA file to set up your connection with JDeveloper. You create the files using Oracle Studio before setting up the BPEL process or Mediator connections.

For information on how to create JCA configuration files, see Create the JCA Configuration Files. To create the files for the Hospital_CDCQueue adapter, do the following:

  1. From the Configuration pane in Oracle Studio, expand the binding for the CDC staging area that you created. The name of the binding is the Project name for the CDC solution that you created in Oracle Studio with the suffix _SA.

  2. Right-click the Hospital_CDCQueue adapter and select Generate JCA Configuration Files.

  3. Save the files to a place you can find when you create the BPEL process or Mediator connection.