Is there a better way to compare and search for DB records
I wrote this application at my job that update records in a database. I store my db records in an Arraylist and the xml records with the update information are stored in a map. I just iterate through my dbrecords and compare the primary key field to the ones in my map.
(for all my db records x )
foundRec = xmlMap.get(x.key)
if (foundRec != null )
do some update etc...
This works fine, and seems to be pretty fast. Is there a better way to do this? I'm always open to new ways of searching or comparing data. Or maybe someone has done something similar in the past and used a totally different and more efficient way.