@Override
  public void executeNonQueryStatement(String sql)
      throws StatementExecutionException, IoTDBConnectionException {

    // 'use XXX' and 'set sql_dialect' is forbidden in SessionPool.executeNonQueryStatement
    if (isUseDatabase(sql) || isSetSqlDialect(sql)) {
      throw new IllegalArgumentException(
          String.format("SessionPool doesn't support executing %s directly", sql));
    }

    ISession session = getSession();
    try {
      session.executeNonQueryStatement(sql);
      putBack(session);
    } catch (IoTDBConnectionException e) {
      // TException means the connection is broken, remove it and get a new one.
      LOGGER.warn("executeNonQueryStatement failed", e);
      cleanSessionAndMayThrowConnectionException(session, FINAL_RETRY, e);
    } catch (StatementExecutionException | RuntimeException e) {
      putBack(session);
      throw e;
    } catch (Throwable e) {
      LOGGER.error("unexpected error in executeNonQueryStatement", e);
      putBack(session);
      throw new RuntimeException(e);
    }
  }
execute non query statement

@param sql non query statement
iotdb-client/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java