adding test scripts
[csql.git] / test / sqlapi / Connect / conntest3.c
blob4765bce3802bd9469b16b682c4173f3689cf75b6
1 /* close the connection and call prepare ,it should fail
3 * Author : Jitendra Lenka
4 */
6 #include"common.h"
8 int main()
10 DbRetVal rv = OK;
11 AbsSqlConnection *con = createConnection();
12 rv = con->connect("root","manager");
13 if(rv !=OK)return 1;
14 printf("Connection opened\n");
15 AbsSqlStatement *stmt = createStatement();
16 stmt->setConnection(con);
17 char statement[200];
18 strcpy(statement,"CREATE TABLE T1(F1 INT);");
19 int rows;
20 rv = con->disconnect();
21 if(rv!=OK)return 2;
22 printf("Connection closed\n");
23 rv = stmt->prepare(statement);
24 if(rv==OK) {
25 delete stmt; delete con;
26 printf("Test script failed\n");
27 return 3;
29 printf("Test script passed\n");
30 delete stmt; delete con;
31 return 0;