Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <printf.h>
- #include <stdlib.h>
- #include <zconf.h>
- #include <sys/time.h>
- #include "jdbcapi.h"
- #include "jni.h"
- int main() {
- JDBC_API *api = jdbcapi_create();
- bool ret = api->get_connection(api, "jdbc:h2:tcp://localhost/~/h2/test", "sa", "test");
- struct timeval tv1, tv2;
- gettimeofday(&tv1, NULL);
- for (int i = 0; i < 1000000; ++i) {
- bool ret2 = api->execute(api, "insert into test(id,name,field,f2) values(nextval('RESTART'),'from c','a','a')");
- }
- gettimeofday(&tv2, NULL);
- printf("Total time = %f seconds\n",
- (double) (tv2.tv_usec - tv1.tv_usec) / 1000000 +
- (double) (tv2.tv_sec - tv1.tv_sec));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement