Class Batch

java.lang.Object
org.jdbi.v3.core.statement.Batch
All Implemented Interfaces:
Closeable, AutoCloseable, Configurable<Batch>

public class Batch extends Object
Represents a group of non-prepared statements to be sent to the RDMBS in one "request".
  • Constructor Details

    • Batch

      public Batch(Handle handle)
  • Method Details

    • add

      public Batch add(String sql)
      Add a statement to the batch
      Parameters:
      sql - SQL to be added to the batch, possibly a named statement
      Returns:
      the same Batch statement
    • execute

      public int[] execute()
      Execute all the queued up statements
      Returns:
      an array of integers representing the return values from each statement's execution
    • getHandle

      public Handle getHandle()
    • getConfig

      public ConfigRegistry getConfig()
      Description copied from interface: Configurable
      Returns the configuration registry associated with this object.
      Specified by:
      getConfig in interface Configurable<This>
      Returns:
      the configuration registry associated with this object.
    • getContext

      public final StatementContext getContext()
      Returns:
      the statement context associated with this statement
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable