adding test scripts
[csql.git] / test / jdbc / Gateway / test054.ksh
blob00e27f4c098b35ef8b15c3ef018c55ff3618e342
1 #!/bin/ksh
2 # Connect with connectstring "jdbc:gateway"
3 # select tuple with WHERE clause having param for some fields(SELECT * FROM t1 WHERE f1=?AND f2=? AND f3=?)
4 # when csqlserver is not runnig
5 # GwTest14.java
6 TESTFILE=${PWD}/jdbc/Gateway/ConnTest01.java
7 REL_PATH=.
8 if [ -s "$TESTFILE" ]
9 then
10 REL_PATH=`pwd`/jdbc/Gateway
12 export CLASSPATH=$CLASSPATH:${REL_PATH}
13 rm -f /tmp/csql.conf
14 cp $CSQL_CONFIG_FILE /tmp/csql.conf
15 export CSQL_CONFIG_FILE=/tmp/csql.conf
16 #export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
17 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
18 echo DSN=$DSN >>$CSQL_CONFIG_FILE
19 DS="$DSN $DBUSER $PASSWORD"
20 rm -f /tmp/csql/csqlds.conf
21 touch /tmp/csql/csqlds.conf
22 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
23 if [ $? -ne 0 ]
24 then
25 exit 1;
28 isql $DS < ${REL_PATH}/t1create.sql >/dev/null 2>&1
29 if [ $? -ne 0 ]
30 then
31 rm -f ${REL_PATH}/t1create.sql
32 exit 1;
34 java GwTest14
35 if [ $? -ne 0 ]
36 then
37 exit 2;
40 echo "drop table t1;">${REL_PATH}/dp.sql
41 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
42 rm -f ${REL_PATH}/dp.sql
43 rm -f ${REL_PATH}/t1create.sql
45 exit 0;