private static void insertData() {
    try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
        Statement statement = connection.createStatement()) {

      statement.addBatch("CREATE DATABASE test");
      statement.addBatch("USE \"test\"");
      statement.addBatch(
          "create table t (tag1 string tag, tag2 string tag, s0 int32 field, s1 int32 field)");

      // insert of data time range :0-100 into fans
      for (int time = 0; time < 100; time++) {

        String sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d2',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d3',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d2',%s,%s)", time, time % 4);
        statement.addBatch(sql);
      }

      // insert large amount of data time range : 1370 ~ 2400
      for (int time = 1370; time < 2400; time++) {

        String sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d2',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d3',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d2',%s,%s)", time, time % 4);
        statement.addBatch(sql);
      }

      // insert large amount of data time range : 300 ~ 1360
      for (int time = 300; time < 1360; time++) {
        // System.out.println("===" + time);
        String sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d2',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d3',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d2',%s,%s)", time, time % 4);
        statement.addBatch(sql);
      }

      statement.addBatch("flush");

      // unsequential data, memory data
      for (int time = 1000; time < 1100; time++) {

        String sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d2',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d3',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d2',%s,%s)", time, time % 4);
        statement.addBatch(sql);
      }

      // sequential data, memory data
      for (int time = 20000; time < 20100; time++) {

        String sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d2',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1,tag2,time,s0) values('fans','d3',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d0',%s,%s)", time, time % 7);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d1',%s,%s)", time, time % 4);
        statement.addBatch(sql);
        sql =
            String.format(
                "insert into t(tag1, tag2,time,s0) values('car','d2',%s,%s)", time, time % 4);
        statement.addBatch(sql);
      }
      assertTrue(Arrays.stream(statement.executeBatch()).allMatch(i -> i == 200));

    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
  }
Notice that, all test begins with "IoTDB" is integration test. All test which will start the
IoTDB server should be defined as integration test.
integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiDeviceTableIT.java