JDBC and Transactions in the WebAuction Application

JDBC is used substantially in the WebAuction application. However, it is not used explicitly during development. Instead, as in the context of a real application, the JDBC access is encapsulated in an EJB. The WebAuction application uses Container Managed Persistence (CMP), which automatically generates JDBC code to map the relational data in the database to an object form.

There is one instance in which explicit JDBC is used in the WebAuction application. It is necessary to use the database to keep a sequence for the WebAuction application to generate new ID numbers for auction items. An EJB is used to encapsulate this SQL.

Get J2EE™ Applications and BEA™ WebLogic Server™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.