Hi everyone, Would anyone recommend me on what I should use if I am pulling data from a table in a database. This data is 4 fields and I don't want to search through a resultset for a particular record to retreive the 4 field values. (Also I can't because the jdbc api says I can't open more than one statement per connection.) So, I would like to store the 4 field values for each record in a, what they call in the C language struct-like, structure. Would HashMap, HashTable, be efficient and sufficient enough for me to handle this operation? If not, what would you recommend me?
Thank you. Allen
Chris Stehno
Ranch Hand
Joined: Feb 26, 2001
Posts: 180
posted
0
Either a HashMap or Hashtable would be fine. I would recommend using a HashMap though, they do not have the forced synchronized methods which slow things down if you don't need them. Hope this helps.
Originally posted by Jamie Robertson: See this series on the collection framework to see if the collection you've chosen fits your requirements Storing Objects in Java by Thomas Paul: