Package com.sleepycat.db

Examples of com.sleepycat.db.Db


        return env;
    }

    public static Db open(DbEnv environment, String name, boolean isQueue) throws FileNotFoundException, DbException, JMSException {
        int flags = Db.DB_CREATE; // | Db.DB_AUTO_COMMIT
        Db db = new Db(environment, 0);

        if (isQueue) {
            db.setFlags(Db.DB_RENUMBER);
        }
        //  only use Db.DB_RECNUM for list tables as its a performance hog
        int type = Db.DB_BTREE;
        if (isQueue) {
            type = Db.DB_RECNO;
        }
        String databaseName = null;
        DbTxn transaction = createTransaction(environment);
        try {
            db.open(transaction, name, databaseName, type, flags, 0);
            transaction = commitTransaction(transaction);
        }
        finally {
            rollbackTransaction(transaction);
        }
View Full Code Here

TOP

Related Classes of com.sleepycat.db.Db

Copyright © 2018 www.massapicom. 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.