summaryrefslogtreecommitdiff
path: root/lang/sql/jdbc/testg.java
diff options
context:
space:
mode:
Diffstat (limited to 'lang/sql/jdbc/testg.java')
-rw-r--r--lang/sql/jdbc/testg.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/lang/sql/jdbc/testg.java b/lang/sql/jdbc/testg.java
new file mode 100644
index 00000000..a32942a1
--- /dev/null
+++ b/lang/sql/jdbc/testg.java
@@ -0,0 +1,26 @@
+import SQLite.Constants;
+import SQLite.Database;
+import SQLite.Exception;
+import SQLite.Stmt;
+
+public class testg {
+ public static void main(String[] args) throws Exception {
+ Database db = new Database();
+ db.open(":memory:", Constants.SQLITE_OPEN_READWRITE);
+ Stmt createTable = db.prepare("CREATE TABLE test (col1)");
+ createTable.step();
+ createTable.close();
+ Stmt beginTx = db.prepare("BEGIN TRANSACTION");
+ beginTx.step();
+ beginTx.close();
+ for (int i = 0; i < 1000000; i++) {
+ Stmt insert = db.prepare("INSERT INTO test VALUES ('whatever')");
+ insert.step();
+ insert.close();
+ }
+ Stmt commitTx = db.prepare("COMMIT TRANSACTION");
+ commitTx.step();
+ commitTx.close();
+ db.close();
+ }
+}