Update database table using JDBC efficiently
Posted on 2006-05-18
I have a flat file containing fileds such as:
UniqueID(Email address), MainCode, Subcode1, Subcode2, Subcode3, subcode5.
I am constraint to using a Class with instance variables to extract the fields of this file.
Assuming there could be thousands of records in the file and millions of records in the Database table.
Once I have the objects of this class, I need to look at:
First, If the UniqueID(Email Address) exists in the Database table.
If it does, then, Extract the MainCode, and depending on the value of this field....
update certain fields of the Database table...
It might be the case that certain UniqueID(Email Address) does not exist in the table.
I need to know what would be a better approach - in terms of updating the database table...
Just iterate throught the ArrayList of this Class objects and update the database table,
Or some sort of advanced JDBC features...???
Some illustration is appreciated...
Please advise ..
Thanks and regards..