code: public static <E extends Exception> int importData(final DataSet dataset, final int offset, final int count,
              final Try.Predicate<? super Object[], E> filter, final PreparedStatement stmt, final int batchSize, final int batchInterval,
              final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException, E {
          N.checkArgument(offset >= 0 && count >= 0, "'offset'=%s and 'count'=%s can't be negative", offset, count);
          N.checkArgument(batchSize > 0 && batchInterval >= 0, "'batchSize'=%s must be greater than 0 and 'batchInterval'=%s can't be negative", batchSize,
                  batchInterval);
  
          final int columnCount = dataset.columnNameList().size();
          final Object[] row = new Object[columnCount];
          int result = 0;
  
          try {
              for (int i = offset, size = dataset.size(); result < count && i < size; i++) {
                  dataset.absolute(i);
  
                  for (int j = 0; j < columnCount; j++) {
                      row[j] = dataset.get(j);
                  }
  
                  if (filter != null && filter.test(row) == false) {
                      continue;
                  }
  
                  stmtSetter.accept(stmt, row);
  
                  stmt.addBatch();
  
                  if ((++result % batchSize) == 0) {
                      stmt.executeBatch();
                      stmt.clearBatch();
  
                      if (batchInterval > 0) {
                          N.sleep(batchInterval);
                      }
                  }
              }
  
              if ((result % batchSize) > 0) {
                  stmt.executeBatch();
                  stmt.clearBatch();
              }
          } catch (SQLException e) {
              throw new UncheckedSQLException(e);
          }
  
          return result;
      }
docs: Imports the data from <code>DataSet</code> to database.
  
  @param dataset
  @param offset
  @param count
  @param filter
  @param stmt the column order in the sql must be consistent with the column order in the DataSet.
  @param batchSize
  @param batchInterval
  @param stmtSetter
  @param columnTypeMap
  @return
  @throws UncheckedSQLException