I have a map with huge amount of data being populated (around 300,000 records in approx)
and iterating it as below ,
for (Map.Entry&
You should use jdbc batch update feature.
While iterating over map you add batch to your prepared statement. When you has added (say) 2000 records, you call stmt.batchUpdate() which will update 2000 diferent records in fast way.
Some example you can see here:
http://www.mkyong.com/jdbc/jdbc-preparedstatement-example-batch-update/
Second thing - If you can, make transaction commit after each batchUpdate. Transaction for 300k records may be to much for your database configuration. Splitting this update into many transactions will have better performance - but only if you can not to have transaction on all records.