1 #include <SqlFactory.h>
3 int main(int argc
, char **argv
)
6 struct timeval timeout
;
7 struct timeval timeStamp
;
8 AbsSqlConnection
*con
= SqlFactory::createConnection(CSql
);
9 rv
= con
->connect("root","manager");
11 AbsSqlStatement
*stmt
= SqlFactory::createStatement(CSql
);
12 stmt
->setConnection(con
);
17 strcpy(statement
,"INSERT INTO t1 VALUES(1234,100);");
18 rv
= stmt
->prepare(statement
);
19 if(rv
!=OK
) { delete stmt
; delete con
; return 4; }
21 rv
= con
->beginTrans();