Creating Types

Chapter 7 detailed using SQL to populate the various “type” tables (USER_TYPES and ACCOUNT_TYPES). As explained in the text, this was necessary because only local interfaces were available for the relevant entity beans. This section provides the SQL scripts for that task on various databases.

Cloudscape

The SQL script shown in Example A-26 creates the user and account type data on Cloudscape databases.

Example A-26. SQL Script for Creating Type Data on Cloudscape Databases

-- Create User Types
INSERT INTO USER_TYPES VALUES (1, 'Client');
INSERT INTO USER_TYPES VALUES (2, 'Employee');

-- Create Account Types
INSERT INTO ACCOUNT_TYPES VALUES (1, 'Everyday');
INSERT INTO ACCOUNT_TYPES VALUES (2, 'Investment');
INSERT INTO ACCOUNT_TYPES VALUES (3, 'Investment Plus');
INSERT INTO ACCOUNT_TYPES VALUES (4, 'Money Market');
INSERT INTO ACCOUNT_TYPES VALUES (5, 'Savings');

InstantDB

Example A-27 is an SQL script that creates types on InstantDB databases.

Example A-27. SQL Script for Creating Type Data on InstantDB Databases

; Load InstantDB JDBC drivers d org.enhydra.instantdb.jdbc.idbDriver; o jdbc:idb=forethought.prp; ; Create User Types e INSERT INTO USER_TYPES VALUES (1, 'Client'); e INSERT INTO USER_TYPES VALUES (2, 'Employee'); ; Create Account Types e INSERT INTO ACCOUNT_TYPES VALUES (1, 'Everyday'); e INSERT INTO ACCOUNT_TYPES VALUES (2, 'Investment'); e INSERT INTO ACCOUNT_TYPES VALUES (3, 'Investment Plus'); e INSERT INTO ACCOUNT_TYPES VALUES (4, 'Money Market'); ...

Get Building Java Enterprise Applications 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.