Setting Up Database Access - Sun Microsystems GlassFish Enterprise Server 2.1 Administration Manual

Hide thumbs Also See for GlassFish Enterprise Server 2.1:
Table of Contents

Advertisement

3. Now that it is connected to the database, the application can read, modify, and add data to
4. When it is finished accessing the database, the application closes the connection.

Setting Up Database Access

To setup a database access:
1. Install a supported database product.
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.
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.
2. Restart the domain.
3. Identify the fully-qualified path name for the driver's JAR file.
Chapter 3 • JDBC Resources
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.
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.
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.
For a list of database products supported by the Enterprise Server, see the Release Notes.
Usually, the application provider delivers scripts for creating and populating the database.
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.
Setting Up Database Access
45

Advertisement

Table of Contents
loading

Table of Contents