Skip to content

Commit d16757b

Browse files
committed
Support a Statement.getMoreResults feature
Add support for two methods getMoreResults and its synonym getMoreResults(CLOSE_CURRENT_RESULT). Tarantool does not support multiple results per one query. It leads both KEEP_CURRENT_RESULT and CLOSE_ALL_RESULTS modes are not supported by the driver. Closes: #182
1 parent 762ce2f commit d16757b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/org/tarantool/jdbc/SQLStatement.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,21 @@ public int getUpdateCount() throws SQLException {
218218

219219
@Override
220220
public boolean getMoreResults() throws SQLException {
221-
checkNotClosed();
222-
return false;
221+
return getMoreResults(Statement.CLOSE_CURRENT_RESULT);
223222
}
224223

225224
@Override
226225
public boolean getMoreResults(int current) throws SQLException {
227226
checkNotClosed();
227+
JdbcConstants.checkCurrentResultConstant(current);
228+
if (resultSet != null &&
229+
(current == KEEP_CURRENT_RESULT || current == CLOSE_ALL_RESULTS)) {
230+
throw new SQLFeatureNotSupportedException();
231+
}
232+
233+
// the driver doesn't support multiple results
234+
// close current result and return no-more-results flag
235+
discardLastResults();
228236
return false;
229237
}
230238

0 commit comments

Comments
 (0)