JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS Database Binding Component Tutorial     Java CAPS Documentation
search filter icon
search icon

Document Information

Using the Database Binding Component

Tutorial Plan

Database Binding Component Project in a Nutshell

Starting the GlassFish V2 Application Server

To Start the GlassFish V2 Application Server From NetBeans IDE

Creating a BPEL Module Project For Table Type Operations

To Create a BPEL Module Project

Connecting to a MySQL Database

To Connect to a MySQL Database

Starting the GlassFish Admin Console

To Start the Admin Console

Setting Up Database Access

Integrating a JDBC Driver

To Integrate a JDBC Driver

Creating a JDBC Connection Pool

To Create a JDBC Connection Pool

To Create a JDBC Resource

Creating a WSDL Document For Type : DATABASE

To Create a WSDL Document : dbWSDL

To Select the Database Connection

To Edit the SQL Code

Source View

Creating a WSDL Document For Type SOAP

To Create a WSDL Document : SOAPWSDL

Creating a BPEL Process

To Create a BPEL Process

To Add a Partner Link

To Add a Web Service and Basic Activities

To Edit Web Service : Receive1

To Edit the Web Service : Invoke1

To Edit the Web Service : Reply1

To Edit the Basic Activities : Assign1

To Edit the Basic Activities : Assign2

Validating BPEL

To Invoke Explicit Validation

Design View : Notifications

The Design View

Creating the Composite Application Project

To Create the Composite Application Project

Deploying and Testing the Composite Application

To Deploy the Composite Application

To Test the Composite Application

Debug the Test Case

To Debug the Test Case

Creating a BPEL Module Process Using Prepared Statements

Creating a BPEL Module Project Using Procedures

Creating a BPEL Module Project Using SQL File

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.

To Create a WSDL Document : dbWSDL

  1. Expand the project node in the Projects window.

    The New WSDL Document wizard appears.

  2. Right-click the project node or Process Files node. Select New —> WSDL Document.
    image:WSDL Document
  3. In the File Name field, enter 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. In the Binding field, select Database from the drop-down list.
  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.
    image:WSDL Document Options
  8. Click Next.
  9. Select the URL from the drop-down list.
    image: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.



    image:Broken icon

To 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.
    image:Database Connections Available
  2. Click Next.
  3. Select the table from the DataSource and Table Objects.
  4. Click the right arrow to move the table from Available Tables to Selected Tables.

    Click the left arrow to remove the table from the list of Selected Tables.


    Note - You can select and move one table at a time.


  5. Click Next.
  6. Select Operation Specific Attributes.
    image: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.



    image:Advanced tab

    Note - Based on the requirement, you can check and deselect 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.


    image:WSDL Doc Created

To Edit the SQL Code

  1. Double-click the created WSDL Document, 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 the ellipsis.

    The jdbc:input — sql Editor appears.

    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=?

    image: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.


    image: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.

image:Source View