code: @SuppressWarnings({ "unchecked" })
      public static <E extends Exception> long importCSV(final Reader reader, long offset, final long count, final Try.Predicate<String[], E> filter,
              final PreparedStatement stmt, final int batchSize, final int batchInterval,
              final Try.BiConsumer<? super PreparedStatement, ? super String[], SQLException> stmtSetter) throws UncheckedSQLException, UncheckedIOException, 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);
  
          long result = 0;
          final BufferedReader br = Objectory.createBufferedReader(reader);
  
          try {
              List<String> tmp = new ArrayList<>();
              String line = br.readLine();
              jsonParser.readString(tmp, line);
              final String[] strs = new String[tmp.size()];
  
              while (offset-- > 0 && br.readLine() != null) {
              }
  
              while (result < count && (line = br.readLine()) != null) {
                  jsonParser.readString(strs, line);
  
                  if (filter != null && filter.test(strs) == false) {
                      continue;
                  }
  
                  stmtSetter.accept(stmt, strs);
                  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);
          } catch (IOException e) {
              throw new UncheckedIOException(e);
          } finally {
              Objectory.recycle(br);
          }
  
          return result;
      }
docs: Imports the data from CSV to database.
  
  @param reader
  @param offset
  @param count
  @param filter
  @param stmt the column order in the sql should be consistent with the column order in the CSV file.
  @param batchSize
  @param batchInterval
  @param stmtSetter
  @return