Using the Database Binding Component

Creating a WSDL Document For Type : DATABASE

In this section, you add a WSDL document, to the BPEL Module project and then use the Partner view of the WSDL editor to configure the components of the WSDL document.

ProcedureTo Create a WSDL Document : dbWSDL

  1. Expand the project node in the Projects window.

    For example, BpelModuleSample

    This opens the New WSDL Document wizard.

  2. Right-click the project node or Process Files node. Select New —> WSDL Document...

    For example, BpelModuleSample

    WSDL Document
  3. Enter the filename in the File Name field.

    For example, dbWSDL.wsdl

  4. Select Concrete WSDL Document.

    • binding

      Defines the message format and protocol details for a port type. For JDBC Binding Component, this is always a message containing a database operation defined using the JDBC API.

    • service

      Indicates which binding to use and how to access the database resource. For Database Binding Component, the address element (<jdbc:address>) specifies the JNDI name for the database resource.

  5. Choose the Binding — Database from the drop-down list.

    The Binding — SOAP is selected and displayed, by default.

  6. Choose any one of the following Types from the drop-down list.

    • Table

    • Prepared Statements

    • Procedures

    • SQL File

  7. Choose Type — Table from the drop-down list.

    WSDL Document Options
  8. Click Next.

  9. Select the URL from the drop-down list.

    Select URL

    You find the MySQL Database is not configured and is not available in the list.


    Note –

    A broken icon indicates that the database is not connected.


    Broken icon

ProcedureTo Select the Database Connection

Before You Begin

See To Create a WSDL Document : dbWSDL to Create the WSDL Document.

  1. Select the URL from the drop-down list.

    Database Connections Available
  2. Click Next.

  3. Select the table from the DataSource and Table Objects.

  4. Click > to move the table from Available Tables to Selected Tables.

    Click < to remove the table from the list of Selected Tables.


    Note –

    You can select and move one table at a time.

    ALL> and <ALL feature is not enabled. This feature will be implemented in future.


  5. Click Next.

  6. Select Operation Specific Attributes.

    Select Operation Attribute
  7. Click Advanced. Select the required Column name.

    You can Insert, Update, Find, and Poll Records.


    Note –

    As the ID is unique, they cannot be unchecked. Hence, these are greyed out.


    Advanced tab
    Note –

    Based on the requirement, you can check and uncheck the Column names.


    1. Choose Select All to select all the Column names.

    2. Choose Clear All to clear all the Column names.

  8. Click OK.

  9. Click Next.

  10. Enter an appropriate JNDI Resource Name.

  11. Click Finish.

    Observe the following:

    • In the Projects window, the IDE adds a dbWSDL.wsdl node under the Process Files node along with the .xsd file.

    • The dbWSDL.wsdl file is open in the WSDL editor.

      The WSDL editor has three views: Source, WSDL, and Partner.

    • The Properties window is open.


      Note –

      If you do not see the Properties window, choose Window —> Properties.


    • The Navigator window is open.

    WSDL Doc Created

ProcedureTo Edit the SQL

  1. Double-click the created WSDL Document.

    For example, dbWSDL.wsdl

    The WSDL Editor is opened.

  2. Expand Bindings —> binding PortType=”jdbcPortype”.

    For instance, you want to perform a find operation.

  3. Select and expand find from the list.

    Expand inputFind and click jdbc:input.

  4. Select sql from Properties.

    Modify the SQL Statement.

  5. Click ellipses (...).

    This opens the jdbc:input — sql editor.

    Make the necessary changes.

    For example,


    select PHONE, STATE, NAME, ZIP, ADDRESSLINE1, ADDRESSLINE2, CREDIT_LIMIT,

    EMAIL, CUSTOMER_ID, CITY, FAX, DISCOUNT_CODE

    from CUSTOMER where NAME=? and CUSTOMER_ID=?
    Structured Query Language File
  6. Click OK.

  7. Click the paramOrder from Properties and enter the values.

    For example, you want to find for NAME and CUSTOMER_ID. Enter the parameter order of the result.

    jdbc input
See Also

WSDL View

Some of the nodes in the WSDL view allow you to add extension attributes.

The Source view appears with the cursor positioned at the beginning of the component's block.

Source View

    In the Source view, the underlying XML source code appears. You can directly edit the XML.

  1. The top of the Source Editor has a tab for each open document. Each tab shows the name of the document.


    Note –

    If the document has been modified and has not been saved, then an asterisk (*) appears after the name. You can right-click a tab to access various commands.


  2. A toolbar is located at the top of the Source Editor window.

  3. Source code displayed in the Source Editor is syntactically colored.

  4. The Source Editor status line is located beneath the horizontal scroll bar. To toggle between insert mode and overwrite mode, use the Insert key.

Source View