Oracle GlassFish Server 3.0.1 Administration Guide

About Database Connectivity

A database management system (DBMS) provides facilities for storing, organizing, and retrieving data. The information in databases is often described as persistent data because it is saved on disk and exists after the application process ends. Most business applications store data in relational databases. Applications can access database information by using the Java Database Connectivity (JDBC) API.

The key elements of database connectivity are the following:

At runtime, the following sequence occurs when an application connects to a database:

  1. The application gets the JDBC resource associated with the database by making a call through the JNDI API.

    Using the JNDI name of the resource, the naming and directory service locates the JDBC resource. Each JDBC resource specifies a connection pool.

  2. Using the JDBC resource, the application gets a database connection.

    GlassFish 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. After the database connection is established, the application can read, modify, and add data to the database.

    The application accesses 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 the application is finished accessing the database, the application closes the connection and returns the connection to the connection pool.