21.7. Creating the Database

In order to run our examples, there has to be a database matching the description provided in the preceding deployment descriptors. Our database schema is very simple, containing only a single table (GAMES) with five fields. The score array from our Game class has been split into two separate fields, because not all databases handle array types. This change has already been reflected in the interface and implementation code for our entity bean.

Listing 21.10 shows the Data Description Language (DDL) schema for an SQL implementation of our database.

Listing 21.10. entitybean.ddl
drop table GAMES;
create table GAMES (
   HOME    varchar(30),
   VISITOR varchar(30),
   WEEK    integer,
   VSCORE  integer,
   HSCORE  integer
);

WebLogic ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.