code: @Override
    public void executePreparedQuery(boolean mustExecuteOnMaster,
        ServerPrepareResult serverPrepareResult, Results results,
        ParameterHolder[] parameters)
        throws SQLException {
  
      cmdPrologue();
  
      try {
  
        int parameterCount = serverPrepareResult.getParameters().length;
  
        //send binary data in a separate stream
        for (int i = 0; i < parameterCount; i++) {
          if (parameters[i].isLongData()) {
            writer.startPacket(0);
            writer.write(COM_STMT_SEND_LONG_DATA);
            writer.writeInt(serverPrepareResult.getStatementId());
            writer.writeShort((short) i);
            parameters[i].writeBinary(writer);
            writer.flush();
          }
        }
  
        //send execute query
        ComStmtExecute.send(writer, serverPrepareResult.getStatementId(), parameters,
                parameterCount, serverPrepareResult.getParameterTypeHeader(), CURSOR_TYPE_NO_CURSOR);
        getResult(results);
  
      } catch (SQLException qex) {
        throw logQuery.exceptionWithQuery(parameters, qex, serverPrepareResult);
      } catch (IOException e) {
        throw handleIoException(e);
      }
    }
docs: Execute a query that is already prepared.
  
  @param mustExecuteOnMaster must execute on master
  @param serverPrepareResult prepare result
  @param results             execution result
  @param parameters          parameters
  @throws SQLException exception