adding test scripts
[csql.git] / test / jdbc / Gateway / test035.ksh
blob9800e32beb673535e51f4d0a131559b7b4e3dd54
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 if [ "$DSN" = "oracle" ]
25 then
26 echo "CREATE TABLE t1 (f1 integer, f2 smallint, f4 number(18), 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 exit 1;
36 echo "drop table t1;">${REL_PATH}/dp.sql
37 sleep 2
38 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
39 if [ $? -ne 0 ]
40 then
41 rm -f ${REL_PATH}/t1create.sql
42 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
43 rm -f ${REL_PATH}/dp.sql
44 exit 2;
47 java GwStmt5
48 if [ $? -ne 0 ]
49 then
50 rm -f ${REL_PATH}/t1create.sql
51 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
52 rm -f ${REL_PATH}/dp.sql
53 exit 3;
56 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
57 if [ $? -ne 0 ]
58 then
59 rm -f ${REL_PATH}/t1create.sql
60 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
61 rm -f ${REL_PATH}/dp.sql
62 exit 4;
64 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
65 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dp.sql >/dev/null 2>&1
66 rm -f ${REL_PATH}/dp.sql
67 rm -f ${REL_PATH}/t1create.sql
68 exit 0;