pro_java thread: Question on storing the results from a DBquery ,while optimising memory usage...
recursive approach? can you elaborate a little more here...
-Thanks
> HashMap is good for a situation where load of data is less, i dont think
this adviceable for chunk of data.
you can use recursive approach...
- pankaj
----- Original Message -----
From: "Nandini" <lbalasubramanyam@y...>
To: "Professional Java" <pro_java@p...>
Sent: Friday, July 26, 2002 10:28 PM
Subject: [pro_java] Question on storing the results from a DBquery ,while
optimising memory usage...
> I'm trying to do a DBQuery and my query returns as many as 1000 rows.
each
> row is meant to represent an object. A I retrieve the values from the
> resulset I'm instantiating an object within the "(while rs.next())" loop
> and storing those attributes in that object and then storing that object
> in a HashMap and returning that HaspMAP. I have a question here...
>
> Is it adviceable to go on creating so many objectinstances as the no of
> rows in the DB? will it not cause a loot of memory to be eaten away while
> I try to create so many objects..
>
> Is the approach I'm following right now the right one?? Any other
solution
> to this?? Any Advise greatly appreciated.
>
> Thanks
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or
> to unsubscribe send a blank email to
>