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.
Specify the database name.
private String dbName = "java:comp/env/jdbc/SavingsAccountDB";
Obtain the DataSource associated with ...