public void delete(Address address) throws SQLException { Connection connection = ds.getConnection(); try { Statement statement = connection.createStatement(); try { statement.executeUpdate("delete from address where id=" + address.getId()); } finally { statement.close(); } } finally { connection.close(); } }
public void update(Address address) throws SQLException { Connection connection = ds.getConnection(); try { Statement statement = connection.createStatement(); try { statement.executeUpdate( "update address set street='" + address.getStreet() + "', city='" + address.getCity() + "', state= '" + address.getState() + "', zip='" + address.getZip() + "' where id=" + address.getId()); } finally { statement.close(); } } finally { connection.close(); } }