adding test scripts
[csql.git] / test / jdbc / Gateway / test032.ksh
bloba4389e95a96c0f94a8c8a80c2a791630ee89de3b
1 #!/bin/ksh
2 #JDBC GATEWAY CACHE
3 TESTFILE=${PWD}/jdbc/Gateway/ConnTest01.java
4 REL_PATH=.
5 if [ -s "$TESTFILE" ]
6 then
7 REL_PATH=`pwd`/jdbc/Gateway
8 fi
9 export CLASSPATH=$CLASSPATH:${REL_PATH}
10 rm -f /tmp/csql.conf
11 cp $CSQL_CONFIG_FILE /tmp/csql.conf
12 export CSQL_CONFIG_FILE=/tmp/csql.conf
13 echo "CACHE_TABLE=true" >>$CSQL_CONFIG_FILE
14 echo DSN=$DSN >>$CSQL_CONFIG_FILE
15 DS="$DSN $DBUSER $PASSWORD"
16 rm -f /tmp/csql/csqlds.conf
17 touch /tmp/csql/csqlds.conf
18 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
19 if [ $? -ne 0 ]
20 then
21 exit 1;
24 echo "create table t1 (f1 int NOT NULL,f2 char(10),primary key(f1));" >${REL_PATH}/t1create.sql
25 isql $DS< ${REL_PATH}/t1create.sql >/dev/null 2>&1
26 if [ $? -ne 0 ]
27 then
28 rm -f ${REL_PATH}/t1create.sql
29 exit 1;
31 echo "drop table t1;">${REL_PATH}/dp.sql
32 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
33 if [ $? -ne 0 ]
34 then
35 rm -f ${REL_PATH}/t1create.sql
36 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
37 rm -f ${REL_PATH}/dp.sql
38 exit 2;
40 java GwStmt2
41 if [ $? -ne 0 ]
42 then
43 rm -f ${REL_PATH}/t1create.sql
44 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
45 rm -f ${REL_PATH}/dp.sql
46 exit 3;
49 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
50 if [ $? -ne 0 ]
51 then
52 rm -f ${REL_PATH}/t1create.sql
53 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
54 rm -f ${REL_PATH}/dp.sql
55 exit 4;
57 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
58 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dp.sql >/dev/null 2>&1
59 rm -f ${REL_PATH}/dp.sql
60 rm -f ${REL_PATH}/t1create.sql
61 exit 0;