Interface ISqlJetCursor

All Known Implementing Classes:
SqlJetCursor, SqlJetIndexOrderCursor, SqlJetIndexScopeCursor, SqlJetReverseOrderCursor, SqlJetRowNumCursor, SqlJetTableDataCursor

public interface ISqlJetCursor
This class represents table cursor that may be used to browse over records in the table, to modify or delete existing records.
  • Method Details

    • close

      void close() throws SqlJetException
      Closes the cursor.
      Throws:
      SqlJetException
    • getRowId

      long getRowId() throws SqlJetException
      Gets row Id of the current record.
      Returns:
      row Id of the current record.
      Throws:
      SqlJetException
    • goTo

      boolean goTo(long rowId) throws SqlJetException
      Goes to the record with the specified row Id.
      Parameters:
      rowId - row Id
      Returns:
      true if cursor was moved successfully.
      Throws:
      SqlJetException
    • eof

      boolean eof() throws SqlJetException
      Tests whether this cursor is positioned behind the last record.
      Returns:
      true if the cursor is not on a record and fields can't be read.
      Throws:
      SqlJetException
    • first

      boolean first() throws SqlJetException
      Goes to the first record.
      Returns:
      true if there is at least one record.
      Throws:
      SqlJetException
    • last

      boolean last() throws SqlJetException
      Goes to the last record.
      Returns:
      true if there is at least one record.
      Throws:
      SqlJetException
    • next

      boolean next() throws SqlJetException
      Goes to the next record.
      Returns:
      true if there is at least one record and end of cursor is not reached yet
      Throws:
      SqlJetException
    • previous

      boolean previous() throws SqlJetException
      Goes to the previous record.
      Returns:
      true if there is at least one record and begin of cursor is not reached yet
      Throws:
      SqlJetException
    • getFieldsCount

      int getFieldsCount() throws SqlJetException
      Returns number of fields in the current record.
      Throws:
      SqlJetException
    • getFieldType

      SqlJetValueType getFieldType(int field) throws SqlJetException
      Returns field type.
      Parameters:
      field - index of the field
      Returns:
      type of field
      Throws:
      SqlJetException
    • getFieldType

      SqlJetValueType getFieldType(String fieldName) throws SqlJetException
      Returns field type.
      Parameters:
      fieldName - name of the field
      Returns:
      type of field
      Throws:
      SqlJetException
    • isNull

      boolean isNull(int field) throws SqlJetException
      Tests field value for null.
      Parameters:
      field - number of field begin from zero
      Returns:
      true if field value is null
      Throws:
      SqlJetException
    • isNull

      boolean isNull(String fieldName) throws SqlJetException
      Tests field value for null.
      Returns:
      true if field value is null
      Throws:
      SqlJetException
    • getString

      String getString(int field) throws SqlJetException
      Returns specified field's value as String.
      Parameters:
      field - index of the field
      Returns:
      field's value as string
      Throws:
      SqlJetException
    • getString

      String getString(String fieldName) throws SqlJetException
      Returns specified field's value as String.
      Parameters:
      fieldName - name of the field
      Returns:
      field's value as string
      Throws:
      SqlJetException
    • getInteger

      long getInteger(int field) throws SqlJetException
      Returns specified field's value as integer.
      Parameters:
      field - index of the field
      Returns:
      field's value as integer
      Throws:
      SqlJetException
    • getInteger

      long getInteger(String fieldName) throws SqlJetException
      Returns specified field's value as integer.
      Parameters:
      fieldName - name of the field
      Throws:
      SqlJetException
    • getFloat

      double getFloat(int field) throws SqlJetException
      Returns specified field's value as float.
      Parameters:
      field - index of the field
      Returns:
      field's value as real
      Throws:
      SqlJetException
    • getFloat

      double getFloat(String fieldName) throws SqlJetException
      Returns specified field's value as float.
      Parameters:
      fieldName - name of the field
      Throws:
      SqlJetException
    • getBoolean

      boolean getBoolean(int field) throws SqlJetException
      Returns specified field's value as boolean.
      Parameters:
      field - index of the field
      Returns:
      field value
      Throws:
      SqlJetException
    • getBoolean

      boolean getBoolean(String fieldName) throws SqlJetException
      Returns specified field's value as boolean.
      Parameters:
      fieldName - name of the field
      Returns:
      field value
      Throws:
      SqlJetException
    • getBlobAsArray

      byte[] getBlobAsArray(int field) throws SqlJetException
      Returns specified field's value as BLOB.
      Parameters:
      field - index of the field
      Returns:
      field's value as BLOB
      Throws:
      SqlJetException
    • getBlobAsArray

      byte[] getBlobAsArray(String fieldName) throws SqlJetException
      Returns specified field's value as BLOB.
      Parameters:
      fieldName - name of the field
      Returns:
      field's value as BLOB
      Throws:
      SqlJetException
    • getBlobAsStream

      InputStream getBlobAsStream(int field) throws SqlJetException
      Returns specified field's value as BLOB.
      Parameters:
      field - number of field begin from zero
      Returns:
      field's value as BLOB
      Throws:
      SqlJetException
    • getBlobAsStream

      InputStream getBlobAsStream(String fieldName) throws SqlJetException
      Returns specified field's value as BLOB.
      Parameters:
      fieldName - name of the field
      Returns:
      field's value as BLOB
      Throws:
      SqlJetException
    • getValue

      Object getValue(int field) throws SqlJetException
      Returns value of the field of the specified index in the current row.
      Parameters:
      field - index of the field
      Throws:
      SqlJetException
    • getValue

      Object getValue(String fieldName) throws SqlJetException
      Returns value of the field with the specified name in the current row.
      Parameters:
      fieldName - name of the field
      Throws:
      SqlJetException
    • getRowValues

      Object[] getRowValues() throws SqlJetException
      Returns all field values of current row.
      Returns:
      field values array
      Throws:
      SqlJetException
    • update

      void update(Object... values) throws SqlJetException
      Updates the current record.
      Parameters:
      values - New record values.
      Throws:
      SqlJetException
    • updateWithRowId

      long updateWithRowId(long rowId, Object... values) throws SqlJetException
      Updates rowId and values in the current record.
      Parameters:
      values - New record values.
      Throws:
      SqlJetException
    • updateByFieldNames

      void updateByFieldNames(Map<String,Object> values) throws SqlJetException
      Updates the current record.
      Parameters:
      values - New record values mapped by field names.
      Throws:
      SqlJetException
    • updateOr

      void updateOr(SqlJetConflictAction onConflict, Object... values) throws SqlJetException
      Updates the current record. Implements ON CONFLICT clause. See SqlJetConflictAction.
      Parameters:
      onConflict - SqlJetConflictAction.
      values - New record values.
      Throws:
      SqlJetException
    • updateWithRowIdOr

      long updateWithRowIdOr(SqlJetConflictAction onConflict, long rowId, Object... values) throws SqlJetException
      Updates rowId and values in the current record. Implements ON CONFLICT clause. See SqlJetConflictAction.
      Parameters:
      onConflict - SqlJetConflictAction.
      values - New record values.
      Throws:
      SqlJetException
    • updateByFieldNamesOr

      void updateByFieldNamesOr(SqlJetConflictAction onConflict, Map<String,Object> values) throws SqlJetException
      Updates the current record. Implements ON CONFLICT clause. See SqlJetConflictAction.
      Parameters:
      onConflict - SqlJetConflictAction.
      values - New record values mapped by field names.
      Throws:
      SqlJetException
    • delete

      void delete() throws SqlJetException
      Deletes the current record.
      Throws:
      SqlJetException
    • reverse

      ISqlJetCursor reverse() throws SqlJetException
      Returns cursor with the order reversed.
      Returns:
      cursor that will traverse the same rows as this one, but in reversed order.
      Throws:
      SqlJetException
    • getRowCount

      long getRowCount() throws SqlJetException
      Returns number of rows accessible with this cursor.
      Returns:
      number of rows
      Throws:
      SqlJetException
    • getRowIndex

      long getRowIndex() throws SqlJetException
      Returns index of the current row. Index is 1-based, first record has index of one.
      Returns:
      1-based index of the current row.
      Throws:
      SqlJetException
    • goToRow

      boolean goToRow(long rowIndex) throws SqlJetException
      Goes to the row with the specified index. Index is 1-based, first record has index of one.
      Parameters:
      rowIndex -
      Returns:
      true if cursor has been set on the specified record.
      Throws:
      SqlJetException
    • setLimit

      void setLimit(long limit) throws SqlJetException
      Sets limit for this cursor. Negative or zero value resets limit to infinity.
      Parameters:
      limit - limit to set or zero to drop the limit.
      Throws:
      SqlJetException
    • getLimit

      long getLimit()
      Returns limit of this cursor.
      Returns:
      limit of this cursor or zero if limit has not been set.