Skip to content

Commit

Permalink
fix multipleResultsetSets bug
Browse files Browse the repository at this point in the history
fix   multipleResultsetSets  bug,when ((stmt.getMoreResults() or stmt.getUpdateCount()!=-1)  and  stmt.getResultSet()==null),will stop check the succedent resultsets and the succedent  resultsets will be lost.
  • Loading branch information
happysearch committed Jun 19, 2017
1 parent 4f0eef2 commit 830741d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,13 @@ private ResultSetWrapper getNextResultSet(Statement stmt) throws SQLException {
try {
if (stmt.getConnection().getMetaData().supportsMultipleResultSets()) {
// Crazy Standard JDBC way of determining if there are more results
if (!((!stmt.getMoreResults()) && (stmt.getUpdateCount() == -1))) {
if (stmt.getMoreResults() || stmt.getUpdateCount() != -1) {
ResultSet rs = stmt.getResultSet();
return rs != null ? new ResultSetWrapper(rs, configuration) : null;
if (rs == null) {
return getNextResultSet(stmt);
} else {
return new ResultSetWrapper(rs, configuration);
}
}
}
} catch (Exception e) {
Expand Down

0 comments on commit 830741d

Please sign in to comment.