类 BatchInsert

java.lang.Object
com.gdxsoft.easyweb.datasource.BatchInsert

public class BatchInsert extends Object
Batch insert into the table
  • 构造器详细资料

    • BatchInsert

      public BatchInsert(DataConnection cnn, boolean transcation)
      Initial class
      参数:
      cnn - the data connection
      transcation - is using transcation , rollback data when an error occurs
  • 方法详细资料

    • insertBatch

      public String insertBatch(String insertHeader, List<String> values)
      Batch insert
      参数:
      insertHeader - the insert SQL header, e.g. insert into tb_a(a,b) values
      values - the list of values e.g. (0,'a')(1,'b')
      返回:
      the errors
    • getMaxInsertCount

      public int getMaxInsertCount()
      Max records insert once (defaults 100)
      返回:
    • setMaxInsertCount

      public void setMaxInsertCount(int maxInsertCount)
      Max records insert once (defaults 100)
      参数:
      maxInsertCount - the max records
    • getMaxInsertSizeKilobit

      public int getMaxInsertSizeKilobit()
      The max kb of the insert sql (defaults 32k)
      返回:
      max kb
    • setMaxInsertSizeKilobit

      public void setMaxInsertSizeKilobit(int maxInsertSizeKilobit)
      The max kb of the insert sql (defaults 32k)
      参数:
      maxInsertSizeKilobit - max kb
    • isTranscation

      public boolean isTranscation()
      Whether is using transcation method (defaults false)
      返回:
    • setTranscation

      public void setTranscation(boolean transcation)
      Whether is using transcation method (defaults false)
      参数:
      transcation -
    • getCnn

      public DataConnection getCnn()
      The database connection
      返回:
      connection
    • setCnn

      public void setCnn(DataConnection cnn)
      The database connection
      参数:
      cnn - connection