Oracle® Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 2 (10.1.2) Part No. B15505-01 |
|
![]() Previous |
![]() Next |
If your entity bean stores its persistent data within a database, you need to create the appropriate table with the proper columns for the entity bean. This table must be created before the bean is loaded into the database. The container will not create this table for BMP beans, but it will create it automatically for CMP beans.
In our employee example, you must create the following table in the database defined in the data-sources.xml
file:
Table | Columns |
---|---|
EMPLOYEEBEAN |
|
The following shows the SQL commands that create these fields.
CREATE TABLE EMPLOYEEBEAN ( EMPNO NUMBER NOT NULL, EMPNAME VARCHAR2(255) NOT NULL, SALARY FLOAT NOT NULL, CONSTRAINT EMPNO PRIMARY KEY )
Note: This book does not cover EJB container services. See the Data Source chapter in the Oracle Application Server Containers for J2EE Services Guide for information on how to configure your Data Source object. |