Class BatchInsertStatementDefault

java.lang.Object
org.spincast.plugins.jdbc.statements.StatementBase
org.spincast.plugins.jdbc.statements.BatchInsertStatementDefault
All Implemented Interfaces:
BatchInsertStatement, Statement

public class BatchInsertStatementDefault extends StatementBase implements BatchInsertStatement
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
  • Constructor Details

    • BatchInsertStatementDefault

      public BatchInsertStatementDefault(Connection connection)
  • Method Details

    • getBatchParams

      protected List<Map<String,Object>> getBatchParams()
    • addBatchParams

      protected void addBatchParams(Map<String,Object> params)
    • addBatch

      public void addBatch()
      Specified by:
      addBatch in interface BatchInsertStatement
    • getBatchInsertSize

      protected int getBatchInsertSize()
    • batchInsert

      public int[] batchInsert()
      Description copied from interface: BatchInsertStatement
      Run the batch insert query. Returns the same informations as the native JDBC specs:
      Specified by:
      batchInsert in interface BatchInsertStatement
    • batchInsert

      public List<Long> batchInsert(String primaryKeyName)
      Description copied from interface: BatchInsertStatement
      Run the batch insert query and return the generated ids, if the current driver supports it.

      Note that some drivers don't support the return of generated keys when using batch inserts. An exception will be throwed if the generated keys cant be retrieved.

      Specified by:
      batchInsert in interface BatchInsertStatement