[HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

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

Moderator: admin

Post Reply
raphaelzintec
Posts: 167
Joined: Sun Apr 21, 2024 10:43 am
Contact:

[HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by raphaelzintec »

not explaining in which case you needa use it

" it is possible for a query to return multiple result sets."
how is it possible? no explanation here

if author doesnt find the need to explain something then he can just erase it from the book instead of giving vague explanations, a book is not made to push the reader to search always on google

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

Re: [HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by admin »

Yes, you are right but in this case it is explained with code. If you were expecting something else, do let us know.
test.png
test.png (56.69 KiB) Viewed 15493 times

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

Re: [HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by admin »

Oh did you mean how to write a query that returns multiple result sets? That's in SQL territory not in Java. Writing SQLs is not the focus of the book. You will not be required to write any query for the exam. You will only be required to know how to use JDBC API to fire them and get result(s).

raphaelzintec
Posts: 167
Joined: Sun Apr 21, 2024 10:43 am
Contact:

Re: [HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by raphaelzintec »

thanks for the last tip

by far i understood that this getMoreResults() is used when you make a query of two tables

polytrack
Posts: 1
Joined: Tue Mar 25, 2025 8:44 pm
Contact:

Re: [HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by polytrack »

raphaelzintec wrote:
Sun Oct 06, 2024 4:50 pm
not explaining in which case you needa use it

" it is possible for a query to return multiple result sets." Poly Track
how is it possible? no explanation here

if author doesnt find the need to explain something then he can just erase it from the book instead of giving vague explanations, a book is not made to push the reader to search always on google
The UNION ALL statement in SQL is used to combine the results of two or more SELECT statements into a single result set. Although the final result is a set, it is made up of the results of many individual queries.

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

Re: [HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by admin »

No, that is not what getMoreResults is for. UNION/UNION ALL returns single result set. Multiple result sets can be returned from stored procedure. You may google it for more details but it is not on the exam.

bekeanloinse
Posts: 4
Joined: Tue Jun 25, 2024 10:11 pm
Contact:

Re: [HD-OCP17/21-Fundamentals Pg 770, Sec. 25.1.5 - retrieving-multiple-resultsets]

Post by bekeanloinse »

Thanks for the clarification, admin. It makes more sense now that multiple result sets typically come from stored drive mad procedures, not just any query with multiple tables or UNION. I think the confusion came from the wording in the book—it could have been clearer about where and how multiple result sets actually originate.

Appreciate the code example too, that really helped solidify how getMoreResults() works in context. 🙏

Post Reply

Who is online

Users browsing this forum: No registered users and 98 guests