JDBC Resources
Thischapter explains how to congure JDBC resources, which are required by applications that
accessdatabases. This chapter contains the following sections:
“JDBCResources” on page 43
“JDBCConnection Pools” on page 44
“HowJDBC Resources and Connection Pools Work Together” on page 44
“SettingUp Database Access” on page 45
“Workingwith JDBC Connection Pools” on page 46
“Congurationsfor Specic JDBC Drivers” on page 52

JDBC Resources

Tostore, organize, and retrieve data, most applications use relational databases. Java EE
applicationsaccess relational databases through the JDBC API.
AJDBC 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
applicationsdeployed in a domain. (However, more than one JDBC resource can be created for
adatabase.)
Tocreate a JDBC resource, specify a unique JNDI name that identies the resource. (See the
sectionJNDI Names and Resources.) Expect to nd the JNDI name of a JDBC resource in
java:comp/env/jdbcsubcontext. For example, the JNDI name for the resource of a payroll
databasecould be java:comp/env/jdbc/payrolldb. Because all resource JNDI names are in
thejava:comp/env subcontext, when specifying the JNDI name of a JDBC resource in the
AdminConsole, enter only jdbc/name. For example, for a payroll database specify
jdbc/payrolldb.
AJDBC resource (data source) provides applications with a means of connecting to a database.
Beforecreating a JDBC resource, rst create a JDBC connection pool.
3
CHAPTER 3
43