Creating BMP Entity Beans

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.

Listing 22.1. Doctor.ddl
CREATE TABLE Doctor (
  ID INTEGER NOT NULL,
  FIRSTNAME VARCHAR(20),
  LASTNAME VARCHAR(20),
  SPECIALTY VARCHAR(20)
);

Creating the Home Interface

The Home interface ...

Get BEA WebLogic Server™ 8.1 Unleashed 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.