Please refer to the following ( from JDK1.2.2 API ): java.sql
Interface Statement All Known Subinterfaces: CallableStatement, PreparedStatement execute public boolean execute(String sql) throws SQLException Executes a SQL statement that may return multiple results. Under some (uncommon) situations a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string. The methods execute, getMoreResults, getResultSet, and getUpdateCount let you navigate through multiple results. The execute method executes a SQL statement and indicates the form of the first result. You can then use getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s). Parameters: sql - any SQL statement Returns: true if the next result is a ResultSet; false if it is an update count or there are no more results Throws: SQLException - if a database access error occurs See Also: getResultSet(), getUpdateCount(), getMoreResults() getResultSet public ResultSet getResultSet() throws SQLException Returns the current result as a ResultSet object. This method should be called only once per result. Returns: the current result as a ResultSet; null if the result is an update count or there are no more results Throws: SQLException - if a database access error occurs See Also: execute(java.lang.String) getMoreResults public boolean getMoreResults() throws SQLException Moves to a Statement's next result. It returns true if this result is a ResultSet. This method also implicitly closes any current ResultSet obtained with getResultSet. There are no more results when (!getMoreResults() && (getUpdateCount() == -1) Returns: true if the next result is a ResultSet; false if it is an update count or there are no more results Throws: SQLException - if a database access error occurs See Also: execute(java.lang.String) ----- Original Message ----- From: "Lenin Lopez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 25, 2001 8:54 AM Subject: multiple resultsets > Hi ALL, > Does anybody know how to access multiple resultsets from a Java application > The 'rs.next' only loops thruogh a single recordset. However I need to > handle mulpiple resultsets comming fro a Store procedure > > Please Help > =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
