Skip Navigation Links | |
Exit Print View | |
Oracle Java CAPS Database Binding Component Tutorial Java CAPS Documentation |
Using the Database Binding Component
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
Creating a JDBC Connection Pool
To Create a JDBC Connection Pool
Creating a WSDL Document For Type : DATABASE
To Create a WSDL Document : dbWSDL
To Select the Database Connection
Creating a WSDL Document For Type SOAP
To Create a WSDL Document : SOAPWSDL
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
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
A Prepared Statement represents a SQL statement that has been compiled. Prepared statements can be used to perform insert, update, delete and query operations. Prepared statements provide the ability to create queries that are more secure, have better performance, and are more convenient to write. They come in two flavors: bound parameter prepared statements, and bound result prepared statements.
Prepared statements allow query templates to be created and then stored on the database server. When a query needs to be made, data to fill in the template is sent to the database server, and a complete query is formed and then executed.
The basic process for creating and using bound parameter prepared statements is simple. A query template is created and sent to the database server. The database server receives the query template, validates it to ensure that it is well-formed, parses it to ensure that it is meaningful, and stores it in a special buffer. It then returns a special handle that can later be used to reference the prepared statement. When a query needs to be made, data to fill in the template is sent to the database server, and then a complete query is formed and then executed.
This process has some very important behaviors wrapped up in it. The body of the query is only sent to the database server once. On requests to execute the query, only the data to fill in the template needs to be delivered to the database server. Most of the work required to validate and parse the query only needs to be done a single time, instead of each time that the query is executed. Additionally, for queries that contain a small amount of data, the overhead of sending the query is greatly reduced.
For steps, see the following links:
Creating a WSDL Document For Type : DATABASE
Select Type — Prepared Statement.
Enter a valid Prepared Statement.
Click Discover Parameters to view types for the parameters.
Click Discover Resultset to discover the Resultset types.
Click Next.
Enter JNDI Name.
Click Finish.
For a demonstration, see http://wiki.open-esb.java.net/Wiki.jsp?page=DatabaseBindingComponentPollScenario.