statement.clearBatch();
/** * Verify that the <code>clearBatch()</code> method of * <code>MMPreparedStatement</code> is clearing the list of batched * commands. * <p> * This is done by first adding command parameter values to the batch and * then invoking the <code>clearBatch()</code> method. * * @throws Exception */ @Test public void testClearBatch() throws Exception { PreparedStatementImpl statement = getMMPreparedStatement("delete from table where col=?"); //$NON-NLS-1$ // Add some stuff statement.setInt(1, new Integer(1)); statement.addBatch(); statement.setInt(1, new Integer(2)); statement.addBatch(); // Make sure something is really there assertTrue("MMPreparedStatement.ParameterValuesList should not be empty", statement.getParameterValuesList().size() > 0); //$NON-NLS-1$ // Now clear it statement.clearBatch(); assertTrue("MMPreparedStatement.ParameterValuesList should be empty", statement.getParameterValuesList().size() == 0); //$NON-NLS-1$ }