execute: Returns true if the first object that the query returns is a ResultSet object. Use this method if the query could return one or more ResultSet objects. Retrieve the ResultSet objects returned from the query by repeatedly calling Statement.getResutSet.
What do they mean by "one or more ResultSet objcets"? if so how is it possible to manage them once got an array of ResultSet?
Whereas st.executeQuery(sql) and st.exectureUpdate(sql) are very clear. It's not (at least to me) the aim of st.execute(sql) which can also return an int as if it was updated a table.
What you are asking is explained in the text that you've quoted. After executing the query (which could even be a stored procedure) You can call Statement.getResutSet again and again to get the result sets returned by the query until you get null.
st.execute() doesn't return int. As you've quoted, it returns a boolean.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.