Working with JDBC Connection Pools
A JDBC connection pool is a group of reusable connections for a particular database. When
creating the pool with the Admin Console, the Administrator is actually dening the aspects of
a connection to a specic database.
Before creating the pool, you must rst install and integrate the JDBC driver. When building
the Create Connection Pool pages, certain data specic to the JDBC driver and the database
vendor must be entered. Before proceeding, gather the following information:
■
Database vendor name
■
Resource type, such as javax.sql.DataSource (local transactions only)
javax.sql.XADataSource (global transactions)
■
Data source class name
■
Required properties, such as the database name (URL), user name, and password
Creating a JDBC Connection Pool
You can use the Admin Console for creating the JDBC connection pool.
▼
Creating a JDBC Connection Pool and JDBC Resource Using the Admin
Console
Copythe JDBC driver for databaseconnectivity toas-install/domains/domain_name/lib/ext.
Alternatively, addthe path to theJDBC driver toclasspath-prefix and restart the server.
In the Admin Console, clickCreate JDBC Connection Pool in theCommonTaskspage.
Provide a namefor the connection pool,select the resourcetype, select the databasevendor.
Click Next.
The Admin Console lists thedefault pool settings and the properties of datasource class
providedby the vendor.
Click the Ping buttonto test the JDBCconnection pool.
In the left-hand paneof the Admin Console,click Resources > JDBCResources.
Click New.
In the NewJDBC Resource page, provide the JNDIname for the resource andthe JDBC
comnnection pool with whichthe JDBC resourceneeds to be associated.
1
2
3
4
5
6
7
8
Workingwith JDBCConnectionPools
SunGlassFishEnterpriseServer2.1AdministrationGuide • December200846