adding test scripts
[csql.git] / test / adapter / Connect / conntest3.c
blob273614ff965fdef9a9376a9132aa3306b514550d
1 //Close the connection and call prepare ,it should be failed
3 #include"common.h"
4 int main()
6 DbRetVal rv = OK;
7 AbsSqlConnection *con = createConnection();
8 rv = con->connect("root","manager");
9 if(rv !=OK)return 1;
10 printf("Connection opened\n");
12 AbsSqlStatement *stmt = createStatement();
13 stmt->setConnection(con);
14 char statement[200];
15 strcpy(statement,"CREATE TABLE t1(f1 INT);");
17 int rows;
18 rv = con->disconnect();
19 if(rv!=OK)return 2;
20 printf("Connection closed\n");
22 rv = stmt->prepare(statement);
23 if(rv==OK)
26 delete stmt;
27 delete con;
28 printf("Test script failed\n");
29 return 3;
31 printf("Test script passed\n");
32 delete stmt;
33 delete con;
34 return 0;