Package org.tmatesoft.sqljet.core.table

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


        }
        return new SqlJetPreparedStatement(db, sql);
    }

    public void exec(final String sql, final SqlJetExecCallback callback) throws SqlJetException {
        db.runWithLock(new ISqlJetRunnableWithLock() {

            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                SqlJetPreparedStatement stmt = prepare(sql);
                try {
                    while (stmt.step()) {
View Full Code Here


        }
        return null;
    }

    public ISqlJetCursor open() throws SqlJetException {
        return (ISqlJetCursor) db.runWithLock(new ISqlJetRunnableWithLock() {
            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                return new SqlJetTableDataCursor(new SqlJetBtreeDataTable(btree, tableName, write), db);
            }
        });
    }
View Full Code Here

        });
    }

    public ISqlJetCursor lookup(final String indexName, final Object... key) throws SqlJetException {
        final Object[] k = SqlJetUtility.adjustNumberTypes(key);
        return (ISqlJetCursor) db.runWithLock(new ISqlJetRunnableWithLock() {
            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                final SqlJetBtreeDataTable table = new SqlJetBtreeDataTable(btree, tableName, write);
                checkIndexName(indexName, table);
                return new SqlJetIndexScopeCursor(table, db, indexName, k, k);
            }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.tmatesoft.sqljet.core.table.ISqlJetTable#order(java.lang.String)
     */
    public ISqlJetCursor order(final String indexName) throws SqlJetException {
        return (ISqlJetCursor) db.runWithLock(new ISqlJetRunnableWithLock() {
            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                final SqlJetBtreeDataTable table = new SqlJetBtreeDataTable(btree, tableName, write);
                checkIndexName(indexName, table);
                return new SqlJetIndexOrderCursor(table, db, indexName);
            }
View Full Code Here

     * @see org.tmatesoft.sqljet.core.table.ISqlJetTable#scope(java.lang.String,
     * java.lang.Object[], java.lang.Object[])
     */
    public ISqlJetCursor scope(final String indexName, SqlJetScope scopethrows SqlJetException {
        final SqlJetScope adjustedScope = SqlJetUtility.adjustScopeNumberTypes(scope);
        return (ISqlJetCursor) db.runWithLock(new ISqlJetRunnableWithLock() {
            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                final SqlJetBtreeDataTable table = new SqlJetBtreeDataTable(btree, tableName, write);
                checkIndexName(indexName, table);
                if (isNeedReverse(getIndexTable(indexName, table), adjustedScope)) {
                    return new SqlJetReverseOrderCursor(new SqlJetIndexScopeCursor(table, db, indexName, adjustedScope.reverse()));
View Full Code Here

     * @see
     * org.tmatesoft.sqljet.core.internal.table.SqlJetTableDataCursor#delete()
     */
    @Override
    public void delete() throws SqlJetException {
        db.runWithLock(new ISqlJetRunnableWithLock() {
            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                SqlJetIndexScopeCursor.super.delete();
                return null;
            }
        });
View Full Code Here

     * @see
     * org.tmatesoft.sqljet.core.internal.table.SqlJetTableDataCursor#getRowId()
     */
    @Override
    public long getRowId() throws SqlJetException {
        return (Long) db.runWithLock(new ISqlJetRunnableWithLock() {
            public Object runWithLock(SqlJetDb db) throws SqlJetException {
                if (indexTable != null && !indexTable.eof()) {
                    return indexTable.getKeyRowId();
                }
                return SqlJetIndexScopeCursor.super.getRowId();
View Full Code Here

TOP

Related Classes of org.tmatesoft.sqljet.core.table.ISqlJetRunnableWithLock

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.