File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Storing data rows in hashmap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Storing data rows in hashmap" Watch "Storing data rows in hashmap" New topic

Storing data rows in hashmap

rachana ravali
Ranch Hand

Joined: Jun 20, 2006
Posts: 32
Hi ,
i have a requirement where i have to put rows from database into hashmap as keys and values.
I have a doubt whether hashmap can support large data such as 2000 records or entries.

Can any one please clarify whether it is a good idea to have such as huge data in maps for avoiding network traffic with database.

Thanks in advance.
Manish Singh
Ranch Hand

Joined: Jan 26, 2007
Posts: 160
If it reduces the DB calls then yes. And you need to look at whats the size of the entry. I mean you should be aware of the total memory taken by the hashmap
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

2000? That isn't "huge". It isn't even "large". Consider that your memory is measured in megabytes -- that's millions of bytes.
rachana ravali
Ranch Hand

Joined: Jun 20, 2006
Posts: 32
thanks manish and paul ... thank you very much for replying..
subject: Storing data rows in hashmap
It's not a secret anymore!