----------------------------------------------------------------------
[csql.git] / test / durability / redologs / stmtTest8.c
blob34535ddcb5ec645b111847da2b08c6a2b1f2346b
1 #include <SqlFactory.h>
3 int main(int argc, char **argv)
5 DbRetVal rv = OK;
6 struct timeval timeout;
7 struct timeval timeStamp;
8 AbsSqlConnection *con = SqlFactory::createConnection(CSql);
9 rv = con->connect("root","manager");
10 if(rv!=OK)return 1;
11 AbsSqlStatement *stmt = SqlFactory::createStatement(CSql);
12 stmt->setConnection(con);
13 char statement[200];
14 int rows =0;
16 // insert into table
17 strcpy(statement,"INSERT INTO t1 VALUES(1234,100);");
18 rv = stmt->prepare(statement);
19 if(rv!=OK) { delete stmt; delete con; return 4; }
20 int rnd = 0;
21 rv = con->beginTrans();
22 con->commit();
23 con->disconnect();
24 delete con;