Package com.almworks.sqlite4java

Examples of com.almworks.sqlite4java.SQLiteConnection.open()


      // Change the default temp_store_directory, otherwise we may run out of disk space as it will go to /var/tmp
      // In EMR the big disks are at /mnt
      // It suffices to set it to . as it is the tasks' work directory
      // Warning: this pragma is deprecated and may be removed in further versions, however there is no choice
      // other than recompiling SQLite or modifying the environment.
      conn.open(true);
      conn.exec("PRAGMA temp_store_directory = '" + new File(".").getAbsolutePath() + "'");
      SQLiteStatement st = conn.prepare("PRAGMA temp_store_directory");
      st.step();
      LOG.info("Changed temp_store_directory to: " + st.columnString(0));
      // journal_mode=OFF speeds up insertions
View Full Code Here


    static SQLiteConnection openDB(String fileName, boolean readOnly) throws SQLiteException {
        SQLiteConnection db = new SQLiteConnection(new File(fileName));
        if (readOnly) {
            db.openReadonly();
        } else {
            db.open(true);
        }
        // set 1GB cache_size:
        final SQLiteStatement stmt = db.prepare("PRAGMA page_size;");
        if (stmt.step()) {
            long cacheSize = stmt.columnLong(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.