db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sai Pullabhotla" <Sai.Pullabho...@jMethods.com>
Subject Updatable ResultSet vs Update/Delete Statements
Date Tue, 22 Jan 2008 16:10:55 GMT
Hello Every One, 



Does any one know how the performance of updatable ResultSets compare to a
regular update/delete statements? 


More Details: 

I've a table which could have several thousands of rows (keeps track of some
history) and need to purge the history on a regular basis if a record is
older than specified number of days. I also need to delete some other files
from the file system that correspond to a specific record. So, I've to do a
SELECT statement based on the DATE, loop through the ResultSet, delete the
files from the file system, and if everything is successful so far, delete
the record from the database. 


Now the question is, should I use an updatable result set when doing my
SELECT statement and use the ResultSet.delete method to delete the current
row, or would it perform better if I get a READ-ONLY result set and fire a
DELETE statement (with the primary key) for every row that I want to delete.


I appreciate your help. 



Sai Pullabhotla


jMethods, Inc. 

Phone: +1 (402) 408-5753 

Fax: +1 (402) 408-6861



View raw message