Page 1 of 1

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

Posted: Sun Oct 06, 2024 4:50 pm
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

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

Posted: Sun Oct 06, 2024 7:42 pm
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 15686 times

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

Posted: Sun Oct 06, 2024 8:01 pm
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).

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

Posted: Mon Oct 07, 2024 1:00 pm
by raphaelzintec
thanks for the last tip

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

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

Posted: Tue Mar 25, 2025 8:47 pm
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.

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

Posted: Tue Mar 25, 2025 11:06 pm
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.

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

Posted: Wed May 14, 2025 4:27 am
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. 🙏