Caveatemptor_script.sql – HP Integrity NonStop J-Series User Manual
Page 222

{
echo $Usage
exit
}
if [ $# -ne 1 ] ;
then
usage
fi
if [ $1 != "T2" ] && [ $1 != "T4" ] ;
then
usage
fi
################################################################################
#CLASSPATHs for JDBC/MX Type 2 Drivers
if [ $1 = T2 ];
then
export CLASSPATH=$CLASSPATH:$t2jdbc/lib/jdbcMx.jar
export CLASSPATH=$CLASSPATH:$t2jdbc/lib/libjdbcMx.so
export _RLD_LIB_PATH=$t2jdbc/lib
fi
################################################################################
################################################################################
#CLASSPATHs for JDBC/MX Type 4 Drivers
if [ $1 = T4 ];
then
export CLASSPATH=$CLASSPATH:$t4jdbc/hibernate/samples/eg/t4sqlmx.jar
fi
################################################################################
################################################################################
#CLASSPATHs for hibernate and third-party libraries
export CLASSPATH=$CLASSPATH:$mavenrepository/antlr/antlr/2.7.6/antlr-2.7.6.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/asm/asm/3.1/asm-3.1.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/cglib/cglib/2.2/cglib-2.2.jar
export
CLASSPATH=$CLASSPATH:$mavenrepository/commons-collections/commons-collections/3.2/commons-collections-3.2.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/javax/transaction/jta/1.1/jta-1.1.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/log4j/log4j/1.2.14/log4j-1.2.14.jar
export CLASSPATH=$CLASSPATH:$hibernatehome/hibernate3.jar
export CLASSPATH=$CLASSPATH:$hibernatehome/lib/hibernate3sqlmx.jar
export CLASSPATH=$CLASSPATH:$hibernatehome/lib/required/slf4j-api-1.5.8.jar
export CLASSPATH=$CLASSPATH:$mavenrepository/org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar
#################################################################################
Caveatemptor_script.sql
(<My SASH Home>\hibernate\samples\eg\dbconfig\caveatemptor_script.sql)
This script file creates database catalog, schema, and database tables for Caveat Emptor.
The content of this file is:
log caveat.log;
drop schema auctioncat.auctionsch cascade;
drop catalog auctioncat;
create catalog auctioncat LOCATION
create schema auctioncat.auctionsch AUTHORIZATION "
set schema auctioncat.auctionsch;
create table auctionitem (id bigint not null, seller bigint not null,
shortDescription varchar(200) not null, description varchar(1000),
ends timestamp, "CONDITION" integer, successfulBid bigint, primary key
(id)) LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
create table auctionuser (id bigint not null, userName varchar(10) not null, "password" varchar(15) not
null, email varchar(255), firstName varchar(50) not null, "initial" char(1), lastName varchar(50) not null,
primary key (id)) LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
create table bid (id bigint not null, isBuyNow char(1) not null, item bigint not null, amount float not
null, "datetime" timestamp not null, bidder bigint not null, primary key (id)) LOCATION <$datavol>
ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
create unique index auctionitem_seller on auctionitem (seller, shortDescription)
LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
alter table auctionitem add constraint FKEECF7FD6F65B1FAF foreign key (successfulBid) references bid;
alter table auctionitem add constraint FKEECF7FD61107FE9B foreign key (seller)
references auctionuser;
create unique index auctionuser_username on auctionuser (userName)
LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
create unique index auctionitem_item_amount on bid (item, amount)
LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
alter table bid add constraint FK17CFDF43A3910 foreign key (bidder)
references auctionuser;
222 Customizing Sample Applications