List of usage examples for java.sql CallableStatement getMoreResults
boolean getMoreResults(int current) throws SQLException;
Statement
object's next result, deals with any current ResultSet
object(s) according to the instructions specified by the given flag, and returns true
if the next result is a ResultSet
object. From source file:org.wso2.carbon.dataservices.core.description.query.SQLQuery.java
private ResultSet getFirstRSOfStoredProc(CallableStatement stmt) throws SQLException { boolean resultAndNoUpdateCount = stmt.execute(); ResultSet result = null;/*from w ww . j a v a 2 s .c o m*/ while (true) { if (!resultAndNoUpdateCount) { if (stmt.getUpdateCount() == -1) { break; } } else { result = stmt.getResultSet(); break; } try { resultAndNoUpdateCount = stmt.getMoreResults(Statement.KEEP_CURRENT_RESULT); } catch (SQLException e) { /* * for some DBMS, this will throw an unsupported feature * exception, even when after a valid result set is retrieved * first, so if there's a valid result set existing, we will * ignore the eventual unsupported feature exception */ if (result == null) { throw e; } break; } } return result; }