You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are multiple results or if the type or number of results returned by a Statement object are not known until run time, the Statement object should be executed with the method execute. The methods getMoreResults, getUpdateCount, and getResultSet can be used to retrieve all the results.
By default, each call to the method getMoreResults closes any previous ResultSet object returned by the method getResultSet. However, the method getMoreResults may take a parameter that specifies whether a ResultSet object returned by getResultSet should be closed. The Statement interface defines three constants that can be supplied to the method getMoreResults:
CLOSE_CURRENT_RESULT — indicates that the current ResultSet object should be closed when the next ResultSet object is returned
KEEP_CURRENT_RESULT — indicates that the current ResultSet object should not be closed when the next ResultSet object is returned
CLOSE_ALL_RESULTS — indicates that any ResultSet objects that have been kept open should be closed when the next result is returned
If the current result is an update count and not a ResultSet object, any parameter passed to getMoreResults is ignored.
To determine whether a driver implements this feature, an application can call the DatabaseMetaData method supportsMultipleOpenResults.
An example:
Statementstmt = conn.createStatement();
booleanretval = cstmt.execute(sql_queries);
ResultSetrs;
intcount;
do {
if (retval == false) {
count = stmt.getUpdateCount();
if (count == -1) {
// no more resultsbreak;
} else {
// process update count
}
} else {
rs = stmt.getResultSet();
// process ResultSet
}
retval = stmt.getMoreResults();
while (true);
Yeah, we need to support getMoreResults() and getMoreResults(ResultSet.CLOSE_CURRENT_RESULT) even though a single result set. Both cases do the same.
Right now, we can just return false and close the current result set to follow the spec. We even can support KEEP_CURRENT_RESULT and CLOSE_ALL_RESULTS for the single result set.
Activity
Totktonada commentedon May 12, 2019
AFAIK, we cannot receive multiple result sets from tarantool sql now. Are we must support it according to JDBC?
[-]jdbc: Support Statement multi results[/-][+]jdbc: Support ResultSet.getMoreResults [/+]nicktorwald commentedon May 13, 2019
Yeah, we need to support
getMoreResults()andgetMoreResults(ResultSet.CLOSE_CURRENT_RESULT)even though a single result set. Both cases do the same.Right now, we can just return
falseand close the current result set to follow the spec. We even can supportKEEP_CURRENT_RESULTandCLOSE_ALL_RESULTSfor the single result set.I renamed the issue to be more precise.
Totktonada commentedon May 20, 2019
Okay. Let's consider this issue as the task to appropriate support the API.
Support a Statement.getMoreResults feature
[-]jdbc: Support ResultSet.getMoreResults [/-][+]jdbc: Support Statement.getMoreResults [/+]Support a Statement.getMoreResults feature
Support a Statement.getMoreResults feature
Support a Statement.getMoreResults feature
Support a Statement.getMoreResults feature