Class AnnotationBatcher.UpdateBatcher

java.lang.Object
net.sf.basedb.core.AnnotationBatcher.UpdateBatcher
Enclosing class:
AnnotationBatcher

static class AnnotationBatcher.UpdateBatcher
extends Object
Batcher implementation for updating and deleting from tables.
  • Field Details

    • sql

      private final String sql
    • statement

      private final PreparedStatement statement
    • parameterTypes

      private final int[] parameterTypes
    • count

      private int count
  • Constructor Details

    • UpdateBatcher

      UpdateBatcher​(Connection c, String sql, int... parameterTypes) throws SQLException
      Prepare a new batcher for the given SQL statement.
      Parameters:
      sql - A SQL statement
      parameterTypes - Parameter type codes as defined in Types.
      Throws:
      SQLException
  • Method Details

    • getSql

      String getSql()
      The SQL statement this batcher is executing.
    • addToBatch

      void addToBatch​(Object... values) throws SQLException
      Add a new entry to the batch. The number of values must match the number of parameter types.
      Throws:
      SQLException
    • flush

      void flush() throws SQLException
      Flush and execute the statements added to the batch.
      Throws:
      SQLException
    • close

      void close()
      Close the batcher.