Hi,
I have a problem regarding performance.
I am updateing 100 records using pst.addBatch(); command.
But it takes 5sec but i need within 2sec.
I am using PreparedStatement.
please reply me how I can improve method.
code is like this
String sql = "update bb_phh_recom set approval_dt= getDate() where phh_recom_id = ? and approval_dt is null ";
pst = conn.prepareStatement(sql);
Integer phhRecomId = null;
int rowsAffected[] = null;
int statusCount = 0;
int listLength = phhRecomIdList.size();
for (int count = 0; count < listLength; count++)
{
phhRecomId = (Integer) phhRecomIdList.get(count);
pst.setInt(1, phhRecomId.intValue());
pst.addBatch();
}
rowsAffected = pst.executeBatch();
|