Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to retrieve content from DAO Class and process in Controller Class?

878867Oct 30 2011 — edited Oct 31 2011
Hello

This is for the experts.

What is the best approach to passing a large set of data from Class A to Class B? I have a DAO Class that connects to a database to retrieve data. I tried saving the data in a collection (map) and passing the collection to Class B. The problem here is that the data is may be too large for a collection without increasing the heap size, it could cause out of memory exception. Instead I'd like to pass the data (row by row) on to the "Controller" Class where which will process each row. I am not sure how to do this without using a collection or some sort. Some tips will be much appreciated.

Note: MVC Rules dictates that Controller cannot call the DAO Class directly, it has to go through the Model which talks directly with the DAO Class.

Thanks

Edited by: 875864 on 30-Oct-2011 15:05
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2011
Added on Oct 30 2011
12 comments
530 views