adding test scripts
[csql.git] / test / jdbc / network / Gateway / test039.ksh
blob3f683e198cdb2238a01ab2ac8d1f375985a1954c
1 #!/bin/ksh
2 #JDBC GATEWAY CACHE
3 TESTFILE=${PWD}/jdbc/network/Gateway/ConnTest01.java
4 REL_PATH=.
5 if [ -s "$TESTFILE" ]
6 then
7 REL_PATH=`pwd`/jdbc/network/Gateway
8 fi
9 export CLASSPATH=$CLASSPATH:${REL_PATH}
11 rm -f /tmp/csql.conf
12 cp $CSQL_CONFIG_FILE /tmp/csql.conf
13 export CSQL_CONFIG_FILE=/tmp/csql.conf
14 echo "CACHE_TABLE=true" >>$CSQL_CONFIG_FILE
15 echo DSN=$DSN >>$CSQL_CONFIG_FILE
16 DS="$DSN $DBUSER $PASSWORD"
17 rm -f /tmp/csql/csqlds.conf
18 touch /tmp/csql/csqlds.conf
19 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
20 if [ $? -ne 0 ]
21 then
22 exit 1;
24 if [ $DSN = "oracle" ]
25 then
26 echo "CREATE TABLE t1 (f1 number(9), f2 number(4), f4 number(37), f5 float, f6 char(10), f7 date, f8 date, f9 timestamp);" >${REL_PATH}/t1create.sql
27 else
28 echo "CREATE TABLE t1 (f1 integer, f2 smallint, f4 bigint, f5 float, f6 char(10), f7 date, f8 time, f9 timestamp);" >${REL_PATH}/t1create.sql
30 isql $DS < ${REL_PATH}/t1create.sql >/dev/null 2>&1
31 if [ $? -ne 0 ]
32 then
33 rm -f ${REL_PATH}/t1create.sql
34 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
35 rm -f ${REL_PATH}/dp.sql
36 exit 1;
38 echo "drop table t1;">${REL_PATH}/dp.sql
39 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
40 if [ $? -ne 0 ]
41 then
42 rm -f ${REL_PATH}/t1create.sql
43 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
44 rm -f ${REL_PATH}/dp.sql
45 exit 2;
47 java GwStmt9
48 if [ $? -ne 0 ]
49 then
50 rm -f /tmp/csql/csqltable.conf
51 touch /tmp/csql/csqltable.conf
52 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dp.sql
53 rm -f ${REL_PATH}/t1create.sql
54 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
55 rm -f ${REL_PATH}/dp.sql
56 exit 3;
59 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
60 if [ $? -ne 0 ]
61 then
62 rm -f ${REL_PATH}/t1create.sql
63 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
64 rm -f ${REL_PATH}/dp.sql
65 exit 4;
67 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
68 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dp.sql >/dev/null 2>&1
69 rm -f ${REL_PATH}/dp.sql
70 rm -f ${REL_PATH}/t1create.sql
71 exit 0;