1 #include <SqlStatement.h>
6 SqlConnection
*con
= new SqlConnection();
7 con
->connect("root", "manager");
8 SqlStatement
*stmt
= new SqlStatement();
9 stmt
->setConnection(con
);
11 //strcpy(statement, "UPDATE t1 SET f2 = 299 WHERE f1 >97");
12 //strcpy(statement, "UPDATE t1 SET f1=290 WHERE f2 > ?");
13 strcpy(statement
, "UPDATE t1 SET f2 = 290 ");
15 rv
= stmt
->prepare(statement
);
16 if (rv
!= OK
) {delete stmt
; delete con
; return 1; }
17 int id1
=160, id2
= 7;
18 //stmt->bindParam(1, &id1);
19 //stmt->bindParam(2, &id2);
29 printf("Update %d %lld %lld %lld\n", rows
, timer
.min(), timer
.max(), timer
.avg());