List of usage examples for java.sql CallableStatement clearParameters
void clearParameters() throws SQLException;
From source file:org.openestate.tool.helloworld.db.hsql.HSqlDbHelloWorldHandler.java
@Override public void removeObjects(Connection c, long[] ids) throws SQLException { if (ids.length < 1) return;/*from w w w .j a v a 2 s .c om*/ final boolean oldAutoCommit = c.getAutoCommit(); CallableStatement removeStatement = null; try { c.setAutoCommit(false); removeStatement = c.prepareCall("CALL " + PROC_REMOVE_HELLOWORLD + "(?);"); for (long id : ids) { removeStatement.clearParameters(); removeStatement.setLong(1, id); removeStatement.execute(); } c.commit(); } catch (SQLException ex) { c.rollback(); throw ex; } finally { JdbcUtils.closeQuietly(removeStatement); c.setAutoCommit(oldAutoCommit); } }