congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SqlJetDb.runReadTransaction
Code IndexAdd Tabnine to your IDE (free)

How to use
runReadTransaction
method
in
org.tmatesoft.sqljet.core.table.SqlJetDb

Best Java code snippets using org.tmatesoft.sqljet.core.table.SqlJetDb.runReadTransaction (Showing top 20 results out of 315)

origin: org.tmatesoft.sqljet/sqljet

public String getString(final String fieldName) throws SqlJetException {
  return (String) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return getBtreeDataTable().getString(getFieldSafe(fieldName));
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public InputStream getBlobAsStream(final String fieldName) throws SqlJetException {
  return (InputStream) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      ISqlJetMemoryPointer buffer = getBtreeDataTable().getBlob(getFieldSafe(fieldName));
      return buffer != null ? new ByteArrayInputStream(SqlJetUtility.readByteBuffer(buffer)) : null;
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public SqlJetValueType getFieldType(final int field) throws SqlJetException {
  return (SqlJetValueType) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.getFieldType(field);
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public boolean getBoolean(final int field) throws SqlJetException {
  return (Boolean) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.getInteger(field) != 0;
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public SqlJetValueType getFieldType(final String fieldName) throws SqlJetException {
  return (SqlJetValueType) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return getBtreeDataTable().getFieldType(getFieldSafe(fieldName));
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public byte[] getBlobAsArray(final String fieldName) throws SqlJetException {
  return (byte[]) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      ISqlJetMemoryPointer buffer = getBtreeDataTable().getBlob(getFieldSafe(fieldName));
      return buffer != null ? SqlJetUtility.readByteBuffer(buffer) : null;
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public Object getValue(final String fieldName) throws SqlJetException {
  return db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      if (SqlJetBtreeDataTable.isFieldNameRowId(fieldName)) {
        return getBtreeDataTable().getRowId();
      } else {
        return getBtreeDataTable().getValue(getFieldSafe(fieldName));
      }
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public int getFieldsCount() throws SqlJetException {
  return (Integer) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.getFieldsCount();
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public long getInteger(final int field) throws SqlJetException {
  return (Long) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.getInteger(field);
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

@Override
public boolean goTo(final long rowId) throws SqlJetException {
  return (Boolean) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      SqlJetIndexScopeCursor.super.goTo(rowId);
      return !eof();
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public boolean goTo(final long rowId) throws SqlJetException {
  return (Boolean) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      final ISqlJetBtreeDataTable table = getBtreeDataTable();
      return table.goToRow(rowId);
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public double getFloat(final String fieldName) throws SqlJetException {
  return (Double) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return getBtreeDataTable().getFloat(getFieldSafe(fieldName));
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public boolean eof() throws SqlJetException {
  return (Boolean) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.eof();
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public boolean last() throws SqlJetException {
  return (Boolean) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.last();
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public Object getValue(final int field) throws SqlJetException {
  return db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      Object value = btreeTable.getValue(field);
      if (value instanceof ISqlJetMemoryPointer) {
        return new ByteArrayInputStream(SqlJetUtility.readByteBuffer((ISqlJetMemoryPointer) value));
      }
      return value;
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public long getRowId() throws SqlJetException {
  return (Long) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      final ISqlJetBtreeDataTable table = getBtreeDataTable();
      if (table.eof()) {
        throw new SqlJetException(SqlJetErrorCode.MISUSE,
            "Table is empty or the current record doesn't point to a data row");
      }
      return table.getRowId();
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public Object[] getRowValues() throws SqlJetException {
  return (Object[]) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      Object[] values = getBtreeDataTable().getValues();
      return values.clone();
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public boolean isNull(final int field) throws SqlJetException {
  return (Boolean) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.isNull(field);
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public String getString(final int field) throws SqlJetException {
  return (String) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      return btreeTable.getString(field);
    }
  });
}
origin: org.tmatesoft.sqljet/sqljet

public InputStream getBlobAsStream(final int field) throws SqlJetException {
  return (InputStream) db.runReadTransaction(new ISqlJetTransaction() {
    public Object run(SqlJetDb db) throws SqlJetException {
      ISqlJetMemoryPointer buffer = btreeTable.getBlob(field);
      return buffer != null ? new ByteArrayInputStream(SqlJetUtility.readByteBuffer(buffer)) : null;
    }
  });
}
org.tmatesoft.sqljet.core.tableSqlJetDbrunReadTransaction

Javadoc

Run read-only transaction.

Popular methods of SqlJetDb

  • getTable
    Open table.
  • open
  • close
  • getOptions
  • createIndex
    Create index from SQL clause.
  • createTable
    Create table from SQL clause.
  • runWithLock
    Do some actions with locking database's internal threads synchronization mutex. It is related only w
  • runWriteTransaction
    Run modifications in write transaction.
  • beginTransaction
  • commit
  • getSchema
    Get database schema.
  • dropIndex
    Drop index.
  • getSchema,
  • dropIndex,
  • dropTable,
  • getTemporaryDatabase,
  • isInTransaction,
  • isOpen,
  • rollback,
  • <init>,
  • alterTable

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Reference (javax.naming)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now