About Question enthuware.ocpjp.v11.2.3644 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
gadsgadsx
Posts: 13
Joined: Fri Apr 12, 2024 11:09 pm
Contact:

About Question enthuware.ocpjp.v11.2.3644 :

Post by gadsgadsx »

The point 4 of explanation states:

Code: Select all

boolean hasResults = stmt.execute();
//check if the stored proc has returned one or more ResultSets 
while (hasResults) {    
  ResultSet rs = stmt.getResultSet();    
  // process result set    
  hasResults = stmt.getMoreResults(); 
}
The method stmt.getMoreResults() moves the pointer to the next result set? If the procedure returns more than 1 result set, how to iterate between the result sets?
Last edited by admin on Wed Jun 05, 2024 10:33 pm, edited 1 time in total.
Reason: Please put code inside [code] [/code]

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v11.2.3644 :

Post by admin »

gadsgadsx wrote:
Wed Jun 05, 2024 10:06 pm
The method stmt.getMoreResults() moves the pointer to the next result set?
Yes. See this https://docs.oracle.com/en/java/javase/ ... oreResults()
If the procedure returns more than 1 result set, how to iterate between the result sets?
The code that you have quoted above shows exactly what you have asked.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests