adding test scripts
[csql.git] / test / jdbc / network / Gateway / test040.ksh
blob6fec495d178e86ba89d12877a52d519e67478b2c
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}
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;
23 if [ $DSN = "oracle" ]
24 then
25 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
26 else
27 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
29 isql $DS < ${REL_PATH}/t1create.sql >/dev/null 2>&1
30 if [ $? -ne 0 ]
31 then
32 rm -f ${REL_PATH}/t1create.sql
33 exit 1;
35 echo "drop table t1;">${REL_PATH}/dp.sql
36 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
37 if [ $? -ne 0 ]
38 then
39 rm -f ${REL_PATH}/t1create.sql
40 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
41 rm -f ${REL_PATH}/dp.sql
42 exit 2;
44 java GwStmt10
45 if [ $? -ne 0 ]
46 then
47 rm -f ${REL_PATH}/t1create.sql
48 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
49 rm -f ${REL_PATH}/dp.sql
50 exit 3;
53 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
54 if [ $? -ne 0 ]
55 then
56 rm -f ${REL_PATH}/t1create.sql
57 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
58 rm -f ${REL_PATH}/dp.sql
59 exit 4;
61 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
62 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dp.sql >/dev/null 2>&1
63 rm -f ${REL_PATH}/dp.sql
64 rm -f ${REL_PATH}/t1create.sql
65 exit 0;