adding test scripts
[csql.git] / test / jdbc / network / Gateway / test050.ksh
blob02447681f408f33249916323708ed62ba5549a5c
1 #!/bin/ksh
2 # Connect with connectstring "jdbc:gateway"
3 # Then do (INSERT/UPDATE/DELETE/SELECT) with params statement using gateway statement
4 # It should pass.when csqlserver is not runnig
5 # GwTest10.java
7 TESTFILE=${PWD}/jdbc/network/Gateway/ConnTest01.java
8 REL_PATH=.
9 if [ -s "$TESTFILE" ]
10 then
11 REL_PATH=`pwd`/jdbc/network/Gateway
13 export CLASSPATH=$CLASSPATH:${REL_PATH}
14 rm -f /tmp/csql.conf
15 cp $CSQL_CONFIG_FILE /tmp/csql.conf
16 export CSQL_CONFIG_FILE=/tmp/csql.conf
17 #export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
18 echo "create table t1 (f1 int,f2 char(10),primary key(f1));" >${REL_PATH}/t1create.sql
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 DS="$DSN $DBUSER $PASSWORD"
21 rm -f /tmp/csql/csqlds.conf
22 touch /tmp/csql/csqlds.conf
23 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
24 if [ $? -ne 0 ]
25 then
26 exit 1;
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 java GwTest10
36 if [ $? -ne 0 ]
37 then
38 exit 2;
41 echo "drop table t1;">${REL_PATH}/dp.sql
42 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
43 rm -f ${REL_PATH}/dp.sql
44 rm -f ${REL_PATH}/t1create.sql
46 exit 0;