JDBC Resources
This chapter explains how to configure JDBC resources, which are required by applications that
access databases. This chapter contains the following sections:
■
“JDBC Resources” on page 43
■
“JDBC Connection Pools” on page 44
■
“How JDBC Resources and Connection Pools Work Together” on page 44
■
“Setting Up Database Access” on page 45
■
“Working with JDBC Connection Pools” on page 46
■
“Configurations for Specific JDBC Drivers” on page 52
JDBC Resources
To store, organize, and retrieve data, most applications use relational databases. Java EE
applications access relational databases through the JDBC API.
A JDBC resource (data source) provides applications with a means of connecting to a database.
Typically, the administrator creates a JDBC resource for each database accessed by the
applications deployed in a domain. (However, more than one JDBC resource can be created for
a database.)
To create a JDBC resource, specify a unique JNDI name that identifies the resource. (See the
section JNDI Names and Resources.) Expect to find the JNDI name of a JDBC resource in
java:comp/env/jdbc
subcontext. For example, the JNDI name for the resource of a payroll
database could be
java:comp/env/jdbc/payrolldb
. Because all resource JNDI names are in
the
java:comp/env
subcontext, when specifying the JNDI name of a JDBC resource in the
Admin Console, enter only
jdbc/
name
. For example, for a payroll database specify
jdbc/payrolldb
.
A JDBC resource (data source) provides applications with a means of connecting to a database.
Before creating a JDBC resource, first create a JDBC connection pool.
3
C H A P T E R
3
43
Содержание Sun GlassFish Enterprise Server 2.1
Страница 12: ...12 ...
Страница 13: ...Figures FIGURE 1 1 Enterprise Server Instance 29 FIGURE 9 1 RoleMapping 105 13 ...
Страница 14: ...14 ...
Страница 18: ...18 ...
Страница 38: ...38 ...
Страница 62: ...62 ...
Страница 96: ...96 ...
Страница 126: ...126 ...
Страница 160: ...160 ...
Страница 214: ...214 ...
Страница 218: ...218 ...
Страница 230: ...230 ...