1 #include <SqlStatement.h>
6 SqlConnection
*con
= new SqlConnection();
7 con
->connect("praba", "manager");
8 SqlStatement
*stmt
= new SqlStatement();
9 stmt
->setConnection(con
);
11 strcpy(statement
, "SELECT * from t1 ;");
13 rv
= stmt
->prepare(statement
);
14 if (rv
!= OK
) {delete stmt
; delete con
; return 1; }
15 int id1
=100, id2
= 100;
17 rv
= stmt
->bindField(1, &id1
);
18 if (rv
!= OK
) {delete stmt
; delete con
; return 2; }
19 rv
= stmt
->bindField(2, &id2
);
20 if (rv
!= OK
) {delete stmt
; delete con
; return 3; }
29 tuple
= (char*)stmt
->fetch() ;
30 if (tuple
== NULL
) { break; }
31 printf("f1=%d f2=%d\n", id1
, id2
);
37 printf("Select %d %lld %lld %lld\n", icount
, timer
.min(), timer
.max(), timer
.avg());