code: public void executeSqlFile( File file, int chunks, boolean eachLineAnSql ) throws Exception {
          execOnConnection(mConn -> {
              boolean autoCommit = mConn.getAutoCommit();
              mConn.setAutoCommit(false);
  
              Predicate<String> validSqlLine = s -> s.length() != 0 //
                      && !s.startsWith("BEGIN") //
                      && !s.startsWith("COMMIT") //
              ;
              Predicate<String> commentPredicate = s -> !s.startsWith("--");
  
              try (IHMStatement pStmt = mConn.createStatement()) {
                  final int[] counter = {1};
                  Stream<String> linesStream = null;
                  if (eachLineAnSql) {
                      linesStream = Files.lines(Paths.get(file.getAbsolutePath())).map(s -> s.trim()).filter(commentPredicate)
                              .filter(validSqlLine);
                  } else {
                      linesStream = Arrays.stream(Files.lines(Paths.get(file.getAbsolutePath())).filter(commentPredicate)
                              .collect(Collectors.joining()).split(";")).filter(validSqlLine);
                  }
  
                  Consumer<String> executeAction = s -> {
                      try {
                          pStmt.executeUpdate(s);
                          counter[0]++;
                          if (counter[0] % chunks == 0) {
                              mConn.commit();
                          }
                      } catch (Exception e) {
                          throw new RuntimeException(e);
                      }
                  };
                  linesStream.forEach(executeAction);
                  mConn.commit();
              }
              mConn.setAutoCommit(autoCommit);
  
              return null;
          });
  
      }
docs: Execute a insert/update sql file.
  
  @param file the file to run on this db.
  @param chunks commit interval.
  @throws Exception