Package org.tmatesoft.sqljet.core.table

Examples of org.tmatesoft.sqljet.core.table.SqlJetDb.runTransaction()


        // create database, table and two indices:
        SqlJetDb db = SqlJetDb.open(dbFile, true);
        // set DB option that have to be set before running any transactions:
        db.getOptions().setAutovacuum(true);
        // set DB option that have to be set in a transaction:
        db.runTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
                db.getOptions().setUserVersion(1);
                return true;
            }
        }, SqlJetTransactionMode.WRITE);
View Full Code Here


    try {
      File dbFile = new File("./src/test/data/db/test.db");
      SqlJetFileUtil.deleteFile(dbFile);
      SqlJetDb db = SqlJetDb.open(dbFile, true);
      db.getOptions().setAutovacuum(true);
      db.runTransaction(new ISqlJetTransaction() {
        public Object run(SqlJetDb db) throws SqlJetException {
          db.getOptions().setUserVersion(1);
          return true;
        }
      }, SqlJetTransactionMode.WRITE);
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.