1 #include<SqlStatement.h>
6 SqlConnection
*con
= new SqlConnection();
7 con
->connect("praba", "manager");
9 SqlStatement
*stmt
= new SqlStatement();
10 stmt
->setConnection(con
);
12 //strcpy(statement, "INSERT INTO t1 (f1, f2) VALUES (100, 200);");
13 strcpy(statement
, "INSERT INTO t1 (f1, f2) VALUES (?, ?);");
14 //strcpy(statement, "INSERT INTO t1 VALUES (100, 200);");
15 //strcpy(statement, "INSERT INTO t1 ");
17 rv
= stmt
->prepare(statement
);
18 printf("Prepeared\n");
19 int id1
=100, id2
= 100;
20 if (rv
!= OK
) {delete stmt
; delete con
; return -1; }
23 for (int i
= 0 ; i
< 10 ; i
++)
27 stmt
->setIntParam(1, id1
);
28 stmt
->setIntParam(2, id2
);
33 {printf("Sleeping\n"); sleep(10);}
35 printf("Insert %lld %lld %lld\n", timer
.min(), timer
.max(), timer
.avg());