- Since:
- 6
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionintResult set concurrency.intResult set holdability.booleanResult set is closed at commit.booleanForward-only result set.booleanResult set is held (remains open) over commit.booleanResult set is insensitive to changes in the data source.booleanRead-only result set.booleanScrollable result set.booleanResult set is sensitive to changes in the data source.booleanUpdatable result set.static ResultSetBehaviorof()Obtain the default result set behavior (ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY, andResultSet.CLOSE_CURSORS_AT_COMMIT).static ResultSetBehaviorof(int type, int concurrency, int holdability) Returns a — possibly cached — result set behavior for the type, concurrency and holdability.static ResultSetBehaviorof(int type, int concurrency, int holdability, Consumer<SQLWarning> warningConsumer) Returns a — possibly cached — result set behavior for the type, concurrency and holdability.inttype()Result set type.Return a — possibly cached — result set behaviour with concurrency changed toResultSet.CONCUR_READ_ONLY.
-
Method Details
-
type
public int type()Result set type.NOTE: The current implementation will never return
ResultSet.TYPE_SCROLL_SENSITIVE, because it is always downgraded toResultSet.TYPE_SCROLL_INSENSITIVEinof(int, int, int, Consumer).- Returns:
- result set type; one of
ResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVEorResultSet.TYPE_SCROLL_SENSITIVE - See Also:
-
isForwardOnly
public boolean isForwardOnly()Forward-only result set.- Returns:
trueif the result set is forward-only (ResultSet.TYPE_FORWARD_ONLY)- See Also:
-
isScrollable
public boolean isScrollable()Scrollable result set.- Returns:
trueif the result set is scrollable (ResultSet.TYPE_SCROLL_INSENSITIVEorResultSet.TYPE_SCROLL_SENSITIVE)- See Also:
-
isInsensitive
public boolean isInsensitive()Result set is insensitive to changes in the data source.- Returns:
trueif the result set is insensitive to changes (ResultSet.TYPE_FORWARD_ONLYorResultSet.TYPE_SCROLL_INSENSITIVE)- See Also:
-
isSensitive
public boolean isSensitive()Result set is sensitive to changes in the data source.NOTE: In the current implementation, this always returns
false.- Returns:
trueif the result is sensitive to changes (ResultSet.TYPE_SCROLL_SENSITIVE)- See Also:
-
concurrency
public int concurrency()Result set concurrency.- Returns:
- result set concurrency; one of
ResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLE - See Also:
-
isReadOnly
public boolean isReadOnly()Read-only result set.- Returns:
trueif the result set is read-only (ResultSet.CONCUR_READ_ONLY)- See Also:
-
isUpdatable
public boolean isUpdatable()Updatable result set.- Returns:
trueif the result set is updatable (ResultSet.CONCUR_UPDATABLE)- See Also:
-
holdability
public int holdability()Result set holdability.- Returns:
- result set holdability; one of
ResultSet.CLOSE_CURSORS_AT_COMMITorResultSet.HOLD_CURSORS_OVER_COMMIT - See Also:
-
isCloseCursorsAtCommit
public boolean isCloseCursorsAtCommit()Result set is closed at commit.- Returns:
trueif result set is closed at commit (ResultSet.CLOSE_CURSORS_AT_COMMIT)- See Also:
-
isHoldCursorsOverCommit
public boolean isHoldCursorsOverCommit()Result set is held (remains open) over commit.- Returns:
trueif result is held over commit (ResultSet.HOLD_CURSORS_OVER_COMMIT)- See Also:
-
withReadOnly
Return a — possibly cached — result set behaviour with concurrency changed toResultSet.CONCUR_READ_ONLY.Type and holdability may be upgraded or downgraded if required if the new combination would not be supported. In the current implementation, this doesn't actually happen, and type and concurrency are preserved.
- Returns:
- read-only result set behaviour
-
of
Returns a — possibly cached — result set behavior for the type, concurrency and holdability.Unsupported, but valid, combinations may result in upgrading or downgrading the type, concurrency and/or holdability. In the current implementation this only happens for type.
- Parameters:
type- result set type; one ofResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVEorResultSet.TYPE_SCROLL_SENSITIVEconcurrency- result set concurrency; one ofResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLEholdability- result set holdability; one ofResultSet.CLOSE_CURSORS_AT_COMMITorResultSet.HOLD_CURSORS_OVER_COMMIT- Returns:
- derived result set behavior
- Throws:
SQLException- for invalid values oftype,concurrencyorholdability(i.e. not defined by JDBC)- See Also:
-
of
public static ResultSetBehavior of(int type, int concurrency, int holdability, Consumer<SQLWarning> warningConsumer) throws SQLException Returns a — possibly cached — result set behavior for the type, concurrency and holdability.Unsupported, but valid, combinations may result in upgrading or downgrading the type, concurrency and/or holdability. In the current implementation this only happens for type.
- Parameters:
type- result set type; one ofResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVEorResultSet.TYPE_SCROLL_SENSITIVEconcurrency- result set concurrency; one ofResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLEholdability- result set holdability; one ofResultSet.CLOSE_CURSORS_AT_COMMITorResultSet.HOLD_CURSORS_OVER_COMMITwarningConsumer- consumer for reporting a warning when the type, concurrency or holdability is upgraded or downgraded- Returns:
- derived result set behavior
- Throws:
SQLException- for invalid values oftype,concurrencyorholdability(i.e. not defined by JDBC)- See Also:
-
of
Obtain the default result set behavior (ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY, andResultSet.CLOSE_CURSORS_AT_COMMIT).- Returns:
- default result set behaviour
-