Chapter 6
253
6.2.1 Relational Database Integration Technologies
Relational database management systems (RDBMS) are the most prevalent form of
enterprise data store. The J2EE platform provides three technologies for integrating
data in RDBMS:
JDBC Developers can use the JDBC APIs to access relational data in a tab
ular form.
Enterprise JavaBeans container managed persistence (CMP) Developers use
container managed persistence to do object relational (O/R) mapping. By
mapping database table data to Java objects, developers can deal with an object
view of the data rather than a tabular, relational view. CMP also encapsulates
the objects into higher level managed components with transactional and secu
rity features.
Java Data Objects (JDO) An O/R mapping technology that generates Java
classes as opposed to components. Note that JDO is optional in the J2EE 1.4
platform. Since it is optional, your application server may not support JDO, or
it may support JDO in a nonstandard manner.
Data Mapping in EAI Applications on page 274 explains when it is better to
use JDBC, enterprise beans, or JDO.
6.2.1.1
JDBC
The JDBC API defines a standard Java API for integration with relational data
base systems. A Java application uses the JDBC API for obtaining a database con
nection, retrieving database records, executing database queries and stored
procedures, and performing other database functions.
Many application component providers use the JDBC API for accessing rela
tional databases to manage persistent data for their applications.
The JDBC API has two parts: a client API for direct use by developers to
access relational databases and a standard, system level contract between J2EE
servers and JDBC drivers for supporting connection pooling and transactions.
Developers do not use the contract between J2EE servers and JDBC drivers
directly. Rather, J2EE server vendors use this contract to provide pooling and
transaction services to J2EE components automatically. Note that, according to
the JDBC 3.0 specification, the JDBC system level contracts can be the same as
the Connector architecture system contracts. Conceptually, JDBC drivers are
<
New Page 1
Clan Web Hosting