Interface Batch


public interface Batch
Batch of executions of one prepared statement with different arguments, sent to the database in pipelined chunks (no round trip per row). Executed by a terminal operation; each call executes the batch again. Statements returning rows (returning, select) are rejected with IllegalArgumentException: the driver would silently report zero counts for them.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Executes the batch.
    void
    Executes the batch and requires every execution to affect exactly one row.
  • Method Details

    • count

      long count()
      Executes the batch.
      Returns:
      total number of affected rows
      Throws:
      SqlException - on a database error (the cause carries the SQLSTATE of the failing statement)
    • exactlyEach

      void exactlyEach()
      Executes the batch and requires every execution to affect exactly one row.
      Throws:
      IllegalStateException - if some execution affected not exactly one row
      SqlException - on a database error