• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing data rows in hashmap

 
rachana ravali
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20171
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks manish and paul ... thank you very much for replying..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic