Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class object and Database returned result

Status
Not open for further replies.

vcllvc

Programmer
Jul 12, 2001
136
US
hey, folks,
I have another design question would like you guys to give me some advices.

When you query the database and return a dataset/record set, do you still populate the return set into objects then use the objects within your application not the return dataset?

When I develop application, I need to query the database to retrieve data to populate objects. Let say if I have to query a Sale table to get the monthly sale record, I get a dataset/record set from database, then I loop througt each row and create a sale object with the according value. Then I insert each object into an arraylist. After that, I use the arrylist through my application.

Do you guys think this is the good pratice? Somehow, I feel this is a cumbersome process.

Thanks for any comment.
 
Use tools to help you generate code for this! Hibernate is a good one. I assume you'r ein the java world?
 
Read this thread for some discussion on this topic.

thread678-1190345

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top