Interface DBCursor<T>
- Type Parameters:
T- type of the record being returned
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DomainDBCursor,ECLMultiDomainDBCursor,MultiDomainDBCursor
Generic cursor interface into the changelog database. Once it is not used anymore, a cursor must be closed to release
all the resources into the database.
The cursor provides a java.sql.ResultSet like API : it is positioned before the first requested record and needs to
be moved forward by calling next().
Usage:
try (DBCursor cursor = ...) {
while (cursor.next()) {
Record record = cursor.getRecord();
// ... can call cursor.getRecord() again: it will return the same result
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classOptions to create a cursor.static enumRepresents a cursor key positioning strategy. -
Method Summary
-
Method Details
-
getRecord
T getRecord()Getter for the current record.This method will always return
nullwhen- Returns:
- The current record. May be
null.
-
next
Skip to the next record of the database.- Returns:
- true if has next, false otherwise
- Throws:
ChangelogException- When database exception raised.
-
close
default void close()Release the resources and locks used by this Iterator. This method must be called when the iterator is no longer used. Failure to do it could cause DB deadlock.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-