Is this an acceptable way to make sure a java.sql.ResultSet is always closed, and also make sure that an Exception caught is propagated to the caller?
Please don't hesitate to review other aspects of this sample as well.
public void updateReplicationStatus(BeanReplicationTask taskBean, String strStatus) throws Exception {
String strSelect = this.createReplicationSelectStatement(taskBean);
ResultSet resultSet = null;
try {
resultSet = DerbyDog.getResultSet(strSelect);
if (resultSet.next()) {
resultSet.updateString(COLUMN_STATUS, strStatus);
resultSet.updateRow();
}
} catch (Exception e) {
throw e;
} finally {
if (resultSet != null) {
resultSet.close();
}
}
}