memory leak fixes
[csql.git] / test / sqlapi / Connect / conntest3.c
blob4f404c5f6975a4cc039f61d3e687a54b5d38dc12
1 /* close the connection and call prepare ,it should fail
3 * Author : Jitendra Lenka
4 */
6 #include<AbsSqlStatement.h>
7 #include<SqlFactory.h>
9 int main()
11 DbRetVal rv = OK;
12 AbsSqlConnection *con = SqlFactory::createConnection(CSql);
13 rv = con->connect("root","manager");
14 if(rv !=OK)return 1;
15 printf("Connection opened\n");
17 AbsSqlStatement *stmt = SqlFactory::createStatement(CSql);
18 stmt->setConnection(con);
19 char statement[200];
20 strcpy(statement,"CREATE TABLE T1(F1 INT);");
22 int rows;
23 rv = con->disconnect();
24 if(rv!=OK)return 2;
25 printf("Connection closed\n");
28 rv = stmt->prepare(statement);
29 if(rv==OK)
32 delete stmt;
33 delete con;
34 printf("Test script failed\n");
35 return 3;
37 printf("Test script passed\n");
38 delete stmt;
39 delete con;
40 return 0;