private String reapColumn;
public SqliteTable(String filename, String[] tables, String reapTable, String reapColumn) {
+ this(filename, tables, false, reapTable, reapColumn);
+ }
+ public SqliteTable(String filename, String[] tables, boolean fastButDangerous,
+ String reapTable, String reapColumn) {
this.filename = filename;
try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:"+filename);
for(String s : tables)
conn.prepareStatement(s).executeUpdate();
+ conn.prepareStatement("PRAGMA temp_store = MEMORY").executeUpdate();
+ conn.prepareStatement("PRAGMA page_size=4096").executeUpdate();
+ conn.prepareStatement("PRAGMA cache_size=2000").executeUpdate();
+ if (fastButDangerous)
+ conn.prepareStatement("PRAGMA synchronous = OFF").executeUpdate();
}
catch (SQLException e) { throw new RuntimeException(e); }
catch (ClassNotFoundException e) { throw new RuntimeException(e); }
}
}
-}
\ No newline at end of file
+}