adding test scripts
[csql.git] / test / jdbc / network / Gateway / test055.ksh
blob5b42b2ba24277eaff366a3917129c8cdc7061403
1 #!/bin/ksh
2 # Connect with connectstring "jdbc:gateway"
3 # Then do (INSERT/UPDATE/DELETE/SELECT) with params statement using gateway statement, when csqlserver is not running
4 # GwTest15.java
5 TESTFILE=${PWD}/jdbc/network/Gateway/ConnTest01.java
6 REL_PATH=.
7 if [ -s "$TESTFILE" ]
8 then
9 REL_PATH=`pwd`/jdbc/network/Gateway
11 export CLASSPATH=$CLASSPATH:${REL_PATH}
12 rm -f /tmp/csql.conf
13 cp $CSQL_CONFIG_FILE /tmp/csql.conf
14 export CSQL_CONFIG_FILE=/tmp/csql.conf
15 #export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
16 echo "CREATE TABLE t1 (f1 integer, f2 smallint, f3 tinyint, f4 bigint, f5 float, f6 char(10), f7 date, f8 time, f9 timestamp);" >${REL_PATH}/t1create.sql
17 echo DSN=$DSN >>$CSQL_CONFIG_FILE
18 DS="$DSN $DBUSER $PASSWORD"
19 rm -f /tmp/csql/csqlds.conf
20 touch /tmp/csql/csqlds.conf
21 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
22 if [ $? -ne 0 ]
23 then
24 exit 1;
27 isql $DS < ${REL_PATH}/t1create.sql >/dev/null 2>&1
28 if [ $? -ne 0 ]
29 then
30 rm -f ${REL_PATH}/t1create.sql
31 exit 1;
33 java GwTest15
34 if [ $? -ne 0 ]
35 then
36 exit 2;
39 echo "drop table t1;">${REL_PATH}/dp.sql
40 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
41 rm -f ${REL_PATH}/dp.sql
42 rm -f ${REL_PATH}/t1create.sql
44 exit 0;