1 #include<AbsSqlStatement.h>
7 AbsSqlConnection
*con
= SqlFactory :: createConnection(CSqlGateway
);
8 rv
= con
->connect("root","manager");
11 AbsSqlStatement
*stmt
= SqlFactory :: createStatement(CSqlGateway
);
12 stmt
->setConnection(con
);
15 strcpy(statement
,"delete from t1 where f1 = 10;");
18 rv
= stmt
->prepare(statement
);
19 if(rv
!=OK
) { delete stmt
; delete con
; return 1; }
20 rv
= stmt
->execute(rows
);
21 if(rv
!=OK
) { delete stmt
; delete con
; return 2; }
25 printf("csql down: delete from t1(cached table) success\n");
27 strcpy(statement
,"delete from t2 where f1 = 10;");
29 rv
= stmt
->prepare(statement
);
30 if(rv
!=OK
) { delete stmt
; delete con
; return 3; }
31 rv
= stmt
->execute(rows
);
32 if(rv
!=OK
) { printf("csql down: delete from t2(not cached mysql table) failed\n"); delete stmt
; delete con
; return 4; }
33 printf("csql down: delete from t2(not cached mysql table) success\n");
37 strcpy(statement
,"delete from t3 where f1 = 10;");
39 rv
= stmt
->prepare(statement
);
40 if(rv
!=OK
) { printf("csql down: delete from t3(not cached csql table) failed\n"); delete stmt
; delete con
; return 5; }
41 rv
= stmt
->execute(rows
);
42 if(rv
!=OK
) { printf("csql down: delete from t3(not cached csql table) failed\n"); delete stmt
; delete con
; return 6; }
43 printf("csql down: delete from t3(not cached csql table) success\n");