March 2002
Beginner to intermediate
528 pages
10h 12m
English
The persistence type of an enterprise bean determines whether or not you code the connection routine. You must code the connection for enterprise beans that access a database and do not have container-managed persistence. Such beans include entity beans with bean-managed persistence and session beans. For entity beans with container-managed persistence, deploytool generates the connection routines for you.
The code examples in this section are from the SavingsAccountBean class, which connects to the database via the following steps.
1. |
Specify the database name.
private String dbName = "java:comp/env/jdbc/SavingsAccountDB"; |
2. |
Obtain the DataSource associated with ... |