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 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
Creating a BPEL Module Process Using Prepared Statements
Follow these steps to create and configure a database connection:
Make the driver's JAR file accessible to the domain's server instance. See To Integrate a JDBC Driver.
Create a connection pool for the database. See To Create a JDBC Connection Pool.
Create a JDBC resource that points to the connection pool. See To Create a JDBC Resource.
A JDBC driver translates an application's JDBC calls into the protocol of the database server.
When creating the pool with the Admin Console, you are actually defining the aspects of a connection to a specific database. A JDBC connection pool is a group of reusable connections for a particular database. Because creating each new physical connection is time consuming, the server maintains a pool of available connections to increase performance. When an application requests a connection, it obtains one from the pool. When an application closes a connection, the connection is returned to the pool.
Before creating the pool, you must first install and integrate the JDBC driver. See To Integrate a JDBC Driver.
When creating the Create Connection Pools, certain data specific to the JDBC driver and the database vendor must be specified. Before proceeding, gather the following information:
Database vendor name
Resource type (select one of the following options):
javax.sql.DataSource (local transactions only)
java.sql.ConnectionPoolDataSource (local transactions, possible performance improvements)
javax.sql.XADataSource (global transactions)
Data source class name
Required properties, such as the database name (URL), user name, and password
Note - Select New to create a new connection pool from the New Connection Pool page.
See the list of choices above.
Datasource Classname: If the JDBC driver has a Datasource class for the resource type and database vendor specified in the previous page, then the value of the Datasource Classname field is provided. An example for MySQL is com.mysql.jdbc.jdbc2.optional.MysqlDataSource.
Description: A text description of the connection pool.
The values are entered, by default.
The values are entered, by default.
The values are entered, by default.
Applications get a database connection from a connection pool by looking up a data source on the Java Naming and Directory Interface (JNDI) tree and then request a connection. The connection pool associated with the datasource provides the connection to the application.
Before You Begin
Before creating a JDBC resource, first create a JDBC connection pool. See To Create a JDBC Connection Pool.
The JNDI name organizes and locates components within a distributed computing environment similarly to the way that card catalogs organize and represent locations of books in a library. Consequently, the JNDI name becomes an important method of accessing the JDBC resource. By convention, the name begins with the jdbc/string.
For example: jdbc/payrolldb.
Note - Remember to give a forward slash.