private int[] executeBatchSQL() throws TException, BatchUpdateException, SQLException {
    isCancelled = false;
    TSExecuteBatchStatementReq execReq = new TSExecuteBatchStatementReq(sessionId, batchSQLList);
    TSStatus execResp =
        callWithRetryAndReconnect(() -> client.executeBatchStatement(execReq), status -> status);
    int[] result = new int[batchSQLList.size()];
    boolean allSuccess = true;
    StringBuilder message = new StringBuilder(System.lineSeparator());
    for (int i = 0; i < result.length; i++) {
      if (execResp.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
        result[i] = execResp.getSubStatus().get(i).code;
        if (result[i] != TSStatusCode.SUCCESS_STATUS.getStatusCode()
            && result[i] != TSStatusCode.REDIRECTION_RECOMMEND.getStatusCode()) {
          allSuccess = false;
          message
              .append(execResp.getSubStatus().get(i).message)
              .append(" for SQL: \"")
              .append(batchSQLList.get(i))
              .append("\"")
              .append(System.lineSeparator());
        }
      } else {
        allSuccess =
            allSuccess
                && (execResp.getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()
                    || execResp.getCode() == TSStatusCode.REDIRECTION_RECOMMEND.getStatusCode());
        result[i] = execResp.getCode();
        message.setLength(0);
        message.append(execResp.getMessage());
      }
    }
    if (execResp.isSetSubStatus() && execResp.getSubStatus() != null) {
      for (TSStatus status : execResp.getSubStatus()) {
        if (status.getCode() == TSStatusCode.USE_OR_DROP_DB.getStatusCode()) {
          connection.changeDefaultDatabase(status.getMessage());
          break;
        }
      }
    }
    if (!allSuccess) {
      throw new BatchUpdateException(message.toString(), result);
    }
    return result;
  }
There are two kinds of sql here: (1) query sql (2) update sql.

<p>(1) return IoTDBJDBCResultSet or IoTDBNonAlignJDBCResultSet (2) simply get executed
iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java