Database Connections

The Application Server ships with a relational database product named PointBase. The following material shows how the SavingsAccountBean example of Chapter 26 accesses a PointBase database. The SavingsAccountBean component is an entity bean with bean-managed persistence.

Session beans and Web components will use the same approach as SavingsAccountBean to access a database. (Entity beans with container-managed persistence are different. See Chapter 27.)

Coding a Database Connection

For the SavingsAccountBean example, the code that connects to the database is in the entity bean implementation class SavingsAccountBean. The source code for this class is in this directory:

<INSTALL>/j2eetutorial14/ejb/savingsaccount/src/

The ...

Get The J2EE™ Tutorial Second Edition 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.