Interface BatchedStatement

All Superinterfaces:
AutoCloseable, PreparedStatement, Statement, Wrapper

public interface BatchedStatement extends PreparedStatement
A PreparedStatement that supports batching of parameter sets. A batch is executed when the number of parameter sets reaches the batch size. The total number of parameter sets submitted to this statement can be retrieved using getBatchCount(). The total number of rows affected by all executions of this statement can be retrieved using getTotalResult().

The flush() method can be used to execute all currently pending parameter sets, and the number of parameter sets that have not yet been executed can be retrieved using getPendingCount().

Since:
4.5
Author:
Eike Stepper
No Implement
This interface is not intended to be implemented by clients.
No Extend
This interface is not intended to be extended by clients.
  • Method Details

    • getBatchSize

      int getBatchSize()
      Returns the maximum number of parameter sets that can be submitted to this statement before an execution is triggered.
    • getBatchCount

      int getBatchCount()
      Returns the total number of parameter sets submitted to this statement.
    • getTotalResult

      int getTotalResult()
      Returns the total number of rows affected by all executions of this statement. This is the sum of the update counts for each execution.
    • getPendingCount

      int getPendingCount()
      Returns the number of parameter sets that have not yet been executed.
      Since:
      4.14
    • getExecutionCount

      int getExecutionCount()
      Returns the number of executed JDBC batches.
      Since:
      4.14
    • getUnknownResultCount

      int getUnknownResultCount()
      Returns the number of successful JDBC batch entries whose update count is unknown.
      Since:
      4.14
    • flush

      int flush() throws SQLException
      Executes all currently pending parameter sets.
      Throws:
      SQLException
      Since:
      4.14