protected void delete(SimpleFeatureType featureType, Filter filter, Connection cx)
throws IOException {
Statement st = null;
try {
try {
if (dialect instanceof PreparedStatementSQLDialect) {
st = deleteSQLPS(featureType, filter, cx);
PreparedStatement ps = (PreparedStatement) st;
((PreparedStatementSQLDialect) dialect).onDelete(ps, cx, featureType);
ps.execute();
} else {
String sql = deleteSQL(featureType, filter);
st = cx.createStatement();
((BasicSQLDialect) dialect).onDelete(st, cx, featureType);
LOGGER.log(Level.FINE, "Removing feature(s): {0}", sql);
st.execute(sql);
}
} finally {
closeSafe(st);
}
} catch (SQLException e) {
String msg = "Error occured during delete";
throw (IOException) new IOException(msg).initCause(e);
}
}