Examples of ISqlJetTransaction


Examples of org.tmatesoft.sqljet.core.table.ISqlJetTransaction

    public void setUp() throws Exception {
        super.setUp();
        db.createTable("CREATE TABLE IF NOT EXISTS table (name TEXT, count INTEGER)");
        db.createIndex("CREATE UNIQUE INDEX IF NOT EXISTS names_idx ON table(name)");
       
        db.runWriteTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
               
                db.getTable("table").insert("XYZ", 1);
                db.getTable("table").insert("XYZZ", 1);
                db.getTable("table").insert("ABC", 1);
                db.getTable("table").insert("ABCD", 1);
                db.getTable("table").insert("ABCDEF", 1);
                db.getTable("table").insert("A", 1);
               
                return null;
            }
        });

        db.createTable("CREATE TABLE IF NOT EXISTS noindex (id INTEGER PRIMARY KEY)");
        db.runWriteTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
               
                db.getTable("noindex").insert(1);
                db.getTable("noindex").insert(2);
                db.getTable("noindex").insert(3);
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.