- Since:
- 6
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionint
Result set concurrency.int
Result set holdability.boolean
Result set is closed at commit.boolean
Forward-only result set.boolean
Result set is held (remains open) over commit.boolean
Result set is insensitive to changes in the data source.boolean
Read-only result set.boolean
Scrollable result set.boolean
Result set is sensitive to changes in the data source.boolean
Updatable result set.static ResultSetBehavior
of()
Obtain the default result set behavior (ResultSet.TYPE_FORWARD_ONLY
,ResultSet.CONCUR_READ_ONLY
, andResultSet.CLOSE_CURSORS_AT_COMMIT
).static ResultSetBehavior
of
(int type, int concurrency, int holdability) Returns a — possibly cached — result set behavior for the type, concurrency and holdability.static ResultSetBehavior
of
(int type, int concurrency, int holdability, Consumer<SQLWarning> warningConsumer) Returns a — possibly cached — result set behavior for the type, concurrency and holdability.int
type()
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_INSENSITIVE
inof(int, int, int, Consumer)
.- Returns:
- result set type; one of
ResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_SCROLL_SENSITIVE
- See Also:
-
isForwardOnly
public boolean isForwardOnly()Forward-only result set.- Returns:
true
if the result set is forward-only (ResultSet.TYPE_FORWARD_ONLY
)- See Also:
-
isScrollable
public boolean isScrollable()Scrollable result set.- Returns:
true
if the result set is scrollable (ResultSet.TYPE_SCROLL_INSENSITIVE
orResultSet.TYPE_SCROLL_SENSITIVE
)- See Also:
-
isInsensitive
public boolean isInsensitive()Result set is insensitive to changes in the data source.- Returns:
true
if the result set is insensitive to changes (ResultSet.TYPE_FORWARD_ONLY
orResultSet.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:
true
if 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_ONLY
orResultSet.CONCUR_UPDATABLE
- See Also:
-
isReadOnly
public boolean isReadOnly()Read-only result set.- Returns:
true
if the result set is read-only (ResultSet.CONCUR_READ_ONLY
)- See Also:
-
isUpdatable
public boolean isUpdatable()Updatable result set.- Returns:
true
if 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_COMMIT
orResultSet.HOLD_CURSORS_OVER_COMMIT
- See Also:
-
isCloseCursorsAtCommit
public boolean isCloseCursorsAtCommit()Result set is closed at commit.- Returns:
true
if 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:
true
if 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_INSENSITIVE
orResultSet.TYPE_SCROLL_SENSITIVE
concurrency
- result set concurrency; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
holdability
- result set holdability; one ofResultSet.CLOSE_CURSORS_AT_COMMIT
orResultSet.HOLD_CURSORS_OVER_COMMIT
- Returns:
- derived result set behavior
- Throws:
SQLException
- for invalid values oftype
,concurrency
orholdability
(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_INSENSITIVE
orResultSet.TYPE_SCROLL_SENSITIVE
concurrency
- result set concurrency; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
holdability
- result set holdability; one ofResultSet.CLOSE_CURSORS_AT_COMMIT
orResultSet.HOLD_CURSORS_OVER_COMMIT
warningConsumer
- 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
,concurrency
orholdability
(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
-