memory leak fixes
[csql.git] / test / sqlapi / Connect / conntest2.c
bloba8c2b3ad9456e32d54240611caa821aadc79da79
1 /* close the connection and call commit, it should fail
3 * Author : Jitendra Lenka
4 */
7 #include<AbsSqlStatement.h>
8 #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");
18 rv = con->beginTrans();
19 if(rv!=OK)return 2;
21 rv = con->disconnect();
22 if(rv !=OK)return 3;printf("Connection closed\n");
24 rv = con->commit();
25 if(rv==OK)
27 printf("Test script failed\n");
28 return 4;
30 printf("After closing the connection, commit failed\n");
31 printf("Test script pased\n");
32 delete con;
33 return 0;