/** Deletes an existing feature(s) in the database for a particular feature type / table. */ 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); } }
/** * Deletes an existing feature(s) in the database for a particular feature type / table. */ 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)st).execute(); } else { String sql = deleteSQL(featureType, filter); LOGGER.log(Level.FINE, "Removing feature(s): {0}", sql); st = cx.createStatement(); st.execute(sql); } } finally { closeSafe(st); } } catch (SQLException e) { String msg = "Error occured calculating bounds"; throw (IOException) new IOException(msg).initCause(e); } }
String sql = deleteSQL(featureType, filter);