316 IBM Express Runtime V2.1
# special Linux section
if {[string first "Linux" $env(os.name)] == 0} {
# Have to add DB2 environment variables to the server process definition
# This is done to avoid having to source the db2profile
# we want to strip the path down to db2 home
# e.g. /opt/IBM/db2/V8.1/java/db2java.zip becomes /opt/IBM/db2/V8.1
secureDB2 [file dirname [file dirname $JDBCclasspath]] $db2instance
}
# ************************************************************************
# End Main routine
# ************************************************************************
The Table.ddl file
Example A-11 shows the source of the Table.ddl file.
Example: A-11 Table.ddl
DROP TABLE HOLDINGEJB;
DROP TABLE ACCOUNTPROFILEEJB;
DROP TABLE QUOTEEJB;
DROP TABLE KEYGENEJB;
DROP TABLE ACCOUNTEJB;
DROP TABLE ORDEREJB;
CREATE TABLE HOLDINGEJB
(PURCHASEPRICE DECIMAL(10, 2),
HOLDINGID INTEGER NOT NULL,
QUANTITY DOUBLE NOT NULL,
PURCHASEDATE TIMESTAMP,
ACCOUNT_ACCOUNTID INTEGER,
QUOTE_SYMBOL VARCHAR(250));
ALTER TABLE HOLDINGEJB
ADD CONSTRAINT PK_HOLDINGEJB PRIMARY KEY (HOLDINGID);
CREATE TABLE ACCOUNTPROFILEEJB
(ADDRESS VARCHAR(250),
PASSWORD VARCHAR(250),
USERID VARCHAR(250) NOT NULL,
EMAIL VARCHAR(250),
CREDITCARD VARCHAR(250),
FULLNAME VARCHAR(250));
ALTER TABLE ACCOUNTPROFILEEJB
ADD CONSTRAINT PK_ACCOUNTPROFILE2 PRIMARY KEY (USERID);
CREATE TABLE QUOTEEJB
(LOW DECIMAL(10, 2),
OPEN1 DECIMAL(10, 2),
VOLUME DOUBLE NOT NULL,
PRICE DECIMAL(10, 2),
HIGH DECIMAL(10, 2),
COMPANYNAME VARCHAR(250),
SYMBOL VARCHAR(250) NOT NULL,
CHANGE1 DOUBLE NOT NULL);
Appendix A. Source code for Trade6 user programs and script files on Windows 317
ALTER TABLE QUOTEEJB
ADD CONSTRAINT PK_QUOTEEJB PRIMARY KEY (SYMBOL);
CREATE TABLE KEYGENEJB
(KEYVAL INTEGER NOT NULL,
KEYNAME VARCHAR(250) NOT NULL);
ALTER TABLE KEYGENEJB
ADD CONSTRAINT PK_KEYGENEJB PRIMARY KEY (KEYNAME);
CREATE TABLE ACCOUNTEJB
(CREATIONDATE TIMESTAMP,
OPENBALANCE DECIMAL(10, 2),
LOGOUTCOUNT INTEGER NOT NULL,
BALANCE DECIMAL(10, 2),
ACCOUNTID INTEGER NOT NULL,
LASTLOGIN TIMESTAMP,
LOGINCOUNT INTEGER NOT NULL,
PROFILE_USERID VARCHAR(250));
ALTER TABLE ACCOUNTEJB
ADD CONSTRAINT PK_ACCOUNTEJB PRIMARY KEY (ACCOUNTID);
CREATE TABLE ORDEREJB
(ORDERFEE DECIMAL(10, 2),
COMPLETIONDATE TIMESTAMP,
ORDERTYPE VARCHAR(250),
ORDERSTATUS VARCHAR(250),
PRICE DECIMAL(10, 2),
QUANTITY DOUBLE NOT NULL,
OPENDATE TIMESTAMP,
ORDERID INTEGER NOT NULL,
ACCOUNT_ACCOUNTID INTEGER,
QUOTE_SYMBOL VARCHAR(250),
HOLDING_HOLDINGID INTEGER);
ALTER TABLE ORDEREJB
ADD CONSTRAINT PK_ORDEREJB PRIMARY KEY (ORDERID);
ALTER TABLE HOLDINGEJB VOLATILE;
ALTER TABLE ACCOUNTPROFILEEJB VOLATILE;
ALTER TABLE QUOTEEJB VOLATILE;
ALTER TABLE KEYGENEJB VOLATILE;
ALTER TABLE ACCOUNTEJB VOLATILE;
ALTER TABLE ORDEREJB VOLATILE;
CREATE INDEX a.profile_userid on accountejb(profile_userid);
CREATE INDEX h.account_accountid on holdingejb(account_accountid);
CREATE INDEX o.account_accountid on orderejb(account_accountid);
CREATE INDEX o.holding_holdingid on orderejb(holding_holdingid);
CREATE INDEX o.orderstatus on orderejb(orderstatus);
CREATE INDEX o.ordertype on orderejb(ordertype);

Get IBM Express Runtime V2.1 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.