November 2003
Intermediate to advanced
1488 pages
36h 35m
English
The DoctorEJB Entity bean represents information about a doctor. Its attributes are an ID, first name, last name, and specialty. The ID will be an Integer and it will be the primary key. Because this class is already defined and we're using a single value for the primary key, we don't need a custom primary key class for this Entity bean. In this section, we're going to create an Entity bean with BMP that uses JDBC to access a single table named Doctor in a data store. The database definition for this table is shown in Listing 22.1.
CREATE TABLE Doctor ( ID INTEGER NOT NULL, FIRSTNAME VARCHAR(20), LASTNAME VARCHAR(20), SPECIALTY VARCHAR(20) ); |
The Home interface ...
Read now
Unlock full access