The Java Database Connectivity API


JDBC is a significant component of the J2EE architecture as it is the primary mechanism used by a J2EE application server to interact with a Database Server, which serves as a persistent data storage repository. Enterprise applications are generally made up of four logical tiers: the client, Web server, application server, and database server. In a multi-tiered architecture, each tier is a server to the lower tier, and a client to the upper tier . The core Java libraries with the J2EE extensions include the collection of APIs that provide the interface for the communication between the tiers. Thus, the application server tier, which is the container for the Enterprise Java Beans, is a client to the Database Server tier. The API to communicate with the database server is Java Database Connectivity (JDBC) . If you are using entity beans with Bean Managed Persistence (BMP), you will be coding JDBC to save and restore your beans' state. If your application uses entity beans with Container Managed Persistence (CMP), you must provide the object-to-relational mapping and allow the application server to manage the JDBC communication. In either case, an understanding of JDBC is essential for J2EE developers. For example, you may have planned to use Container Managed Persistence, but some restriction or drawback forces you to use Bean Managed Persistence, in which case, you need to know JDBC.

To learn more about the object relationships that require bean providers to write the storage and retrieval of persistent data themselves using JDBC, see "Container-Managed Persistence Versus Bean-Managed Persistence," p. 657 .


For further information on Bean Managed Persistence, see Chapter 21, "Managing Persistence ”Entity Beans," p. 655 .


To learn how JDBC works, you will first investigate an application that implements a simple two-tier client/server model. The Java application is the client, and the database server is the server. From this basic understanding of the architecture and API, you will learn how it is integrated into your enterprise application using the BEA WebLogic Server. This detailed knowledge allows you to efficiently and effectively develop enterprise applications. Specifically, your entity beans will contain methods that implement your business logic, as well as ejbCreate() , ejbLoad() , ejbStore() , ejbRemove() , and ejbFind XXX () , which use JDBC to persist your beans.



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net