Class BatchBuilder

java.lang.Object
me.hsgamer.hscore.database.client.sql.BatchBuilder
All Implemented Interfaces:
AutoCloseable

public class BatchBuilder extends Object implements AutoCloseable
The batch builder for continuous updating
  • Constructor Details

    • BatchBuilder

      public BatchBuilder(Connection connection)
      Create a new batch builder
      Parameters:
      connection - the connection
  • Method Details

    • addBatch

      public void addBatch(@Language("SQL") String statement, Object... values)
      Add a statement as batch
      Parameters:
      statement - the statement
      values - the values for the designated parameters
    • execute

      public void execute() throws SQLException
      Execute the batches
      Throws:
      SQLException - if there is an SQL error
    • executeSafe

      public void executeSafe()
      Execute the batches but ignores exceptions
    • clear

      public void clear()
      Clear the batches
    • close

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