replacement for hashmap

Discussions

General J2EE: replacement for hashmap

  1. replacement for hashmap (1 messages)

    Hi, In my j2ee web application am firing a query to oracle data source which would return around 1lakh records and firing another query to mysql data source which would return more than a lakh records. Then I need to compare data in two result sets and should return records which are equal( or based on some condition)currently I am converting data in resultset to hashmap and using hashmap for furthere comparision. So I have 2 hashmaps( one for oracle results and another for mysql resultset) and one to store intermediate results.Its going slow as the number of records in database increases.Is there any way I can optimise and improve performance.If I use resultset then i need to keep jdbc connection open till the end.Please suggest me if i can use disconnected resultset and some info about it
  2. mapReduce may be used[ Go to top ]

    You can consider using MapReduce. Your map() can create return a hashcode for each record. records can be processed as soon as they are read and collected in maps(). The reduce can then combine these to attach duplicates with same hashcode.