The JDBC 3.0 specification allows the
Statement interface to support multiple
open
ResultSets, which removes the limitation of the JDBC 2.0
specification that statements returning multiple results must have only one
ResultSet open at any given time. To support multiple open
results, the
Statement interface adds an overloaded version of the
method
getMoreResults(). The
getMoreResults(int) method takes an integer flag that
specifies the behavior of previously opened
ResultSets when the
getResultSet() method is called. The interface defines the
flags as follows:
-
CLOSE_ALL_RESULTS – all previously opened ResultSet
objects are closed when calling getMoreResults().
-
CLOSE_CURRENT_RESULT – the current ResultSet object are
closed when calling getMoreResults().
-
KEEP_CURRENT_RESULT – the current ResultSet object is
not closed when calling getMoreResults().