adding test scripts
[csql.git] / test / jdbc / Gateway / test053.ksh
blobcbca0c5d25ad7c15ef8e5d16ad226e230d45c0e0
1 #!/bin/ksh
2 # Connect with connectstring "jdbc:gateway"
3 # CREATE TABLE t1 (f1 integer, f2 smallint, f3 tinyint,f4 bigint, f5 float, f6 char(10), f7 date, f8 time, f9 timestamp);
4 # insert 9 tuples with params for all fields (INSERT INTO t1 values (?,?,?,?,?,?,?,?,?))
5 # select tuple with WHERE clause having param for each fields(SELECT * FROM t1 WHERE f1=?, SELECT * from T1 where f2=?)
6 # GwTest13.java
8 TESTFILE=${PWD}/jdbc/Gateway/ConnTest01.java
9 REL_PATH=.
10 if [ -s "$TESTFILE" ]
11 then
12 REL_PATH=`pwd`/jdbc/Gateway
14 export CLASSPATH=$CLASSPATH:${REL_PATH}
15 rm -f /tmp/csql.conf
16 cp $CSQL_CONFIG_FILE /tmp/csql.conf
17 export CSQL_CONFIG_FILE=/tmp/csql.conf
18 #export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
19 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
20 echo DSN=$DSN >>$CSQL_CONFIG_FILE
21 DS="$DSN $DBUSER $PASSWORD"
22 rm -f /tmp/csql/csqlds.conf
23 touch /tmp/csql/csqlds.conf
24 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
25 if [ $? -ne 0 ]
26 then
27 exit 1;
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 java GwTest13
37 if [ $? -ne 0 ]
38 then
39 exit 2;
42 echo "drop table t1;">${REL_PATH}/dp.sql
43 isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1
44 rm -f ${REL_PATH}/dp.sql
45 rm -f ${REL_PATH}/t1create.sql
47 exit 0;