beautypg.com

Setting up database access – Sun Microsystems GLASSFISH ENTERPRISE 820433510 User Manual

Page 45

background image

Behind the scenes, the application server retrieves a physical connection from the
connection pool that corresponds to the database. The pool defines connection attributes
such as the database name (URL), user name, and password.

3. Now that it is connected to the database, the application can read, modify, and add data to

the database.

The applications access the database by making calls to the JDBC API. The JDBC driver
translates the application’s JDBC calls into the protocol of the database server.

4. When it is finished accessing the database, the application closes the connection.

The application server returns the connection to the connection pool. Once it’s back in the
pool, the connection is available for the next application.

Setting Up Database Access

To setup a database access:

1. Install a supported database product.

For a list of database products supported by the Enterprise Server, see the Release Notes.

2. Install a JDBC driver for the database product.

3. Make the driver’s JAR file accessible to the domain’s server instance.

4. Create the database.

Usually, the application provider delivers scripts for creating and populating the database.

5. Create a connection pool for the database.

6. Create a JDBC resource that points to the connection pool.

Now to integrate the JDBC driver into an administrative domain, do either of the following:

1. Make the driver accessible to the common class loader.

Copy the driver’s JAR and ZIP files into the domain-dir/lib directory or copy its class files
into the domain-dir/lib/ext directory.

2. Restart the domain.

3. Identify the fully-qualified path name for the driver's JAR file.

Setting Up Database Access

Chapter 3 • JDBC Resources

45