Ready to get started?

Learn more:

DB2 Connectivity Solutions

Execute Stored Procedures to DB2 in BizTalk



You can use stored procedures provided by the CData BizTalk Adapter for DB2 to automate working with DB2 data in BizTalk. Stored procedures implement actions available in the underlying API.

Stored procedures implement DB2 actions that cannot be represented as SELECT, INSERT, UPDATE, and DELETE statements. This article shows how to generate a schema for a stored procedure. You can use the schema to execute the stored procedure from a send port.

Add the Adapter to Your Project

Use the Add Adapter wizard to add the adapter to a BizTalk Server project in Visual Studio. The adapter will return metadata about the inputs of the stored procedure and its results. This metadata is needed to create the schema.

  1. Right-click on the project in the Solution Explorer and click Add -> Add Generated Items.
  2. Select Add Adapter Metadata in the resulting dialog box.
  3. In the resulting Add Adapter wizard, select the adapter from the list.
  4. In the Port menu, leave the selection blank. Or, select a receive location or send port that has been configured to use the DB2 Adapter.
  5. On the Connection String page, enter authentication credentials and other connection properties if they were not already configured in the send port or the receive location.

    Below is a typical connection string:

    Server=10.0.1.2;Port=50000;User=admin;Password=admin;Database=test;

    Set the following properties to connect to DB2:

    • Server: Set this to the name of the server running DB2.
    • Port: Set this to the port the DB2 server is listening on.
    • Database: Set this to the name of the DB2 database.
    • User: Set this to the username of a user allowed to access the database.
    • Password: Set this to the password of a user allowed to access the database.

    You will also need to install the corresponding DB2 driver:

    • Windows: Install the IBM Data Server Provider for .NET.

      On Windows, installing the IBM Data Server Provider is sufficient, as the installation registers it in the machine.config.

    • Java: Install the IBM Data Server Driver for JDBC.

      In the Java version, place the IBM Data Server Driver JAR in the www\WEB-INF\lib\ folder for this application.

Generate the Schema

After you enter connection properties in the Add Adapter wizard, the Schema wizard is displayed.

  1. On the next page, Schema Information, select the Send Port that you have configured to use the DB2 Adapter.
  2. If you have configured the CData DB2 Adapter in a solicit-response send port, disable the One-Way option.
  3. In the Command Type menu, select Stored Procedure.
  4. Select the stored procedure from the menu and enter the values for the input parameters.
  5. Confirm the settings in the summary displayed by the wizard and click Finish to generate the schema.xsd file.

Processing Schemas

To use schemas in a simple BizTalk application, see the tutorial.