T - type of the record being returned
\@NotThreadSafepublic interface DBCursor<T> extends Closeable
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:
DBCursor cursor = ...;
try {
while (cursor.next()) {
Record record = cursor.getRecord();
// ... can call cursor.getRecord() again: it will return the same result
}
}
finally {
close(cursor);
}
}
A cursor can be initialised from a key, using a KeyMatchingStrategy and
a PositionStrategy, to determine the exact starting position.
Let's call Kp the highest key lower than K and Kn the lowest key higher than K : Kp < K < Kn
| Modifier and Type | Interface and Description |
|---|---|
static class |
DBCursor.CursorOptions
Options to create a cursor.
|
static class |
DBCursor.KeyMatchingStrategy
Represents a cursor key matching strategy, which allow to choose if only
the exact key must be found or if any key equal or lower/higher should match.
|
static class |
DBCursor.PositionStrategy
Represents a cursor positioning strategy, which allow to choose if the start point
corresponds to the record at the provided key or the record just after the provided
key.
|
boolean next() throws ChangelogException
ChangelogException - When database exception raised.void close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2010-2015 ForgeRock AS. All Rights Reserved.