private Result executeCompiledStatement(Result cmd) {

        Statement cs = cmd.getStatement();

        if (!cs.isValid()) {
            long csid = cmd.getStatementID();

            cs = database.compiledStatementManager.getStatement(this, csid);

            if (cs == null) {

                // invalid sql has been removed already
                return Result.newErrorResult(Error.error(ErrorCode.X_07502));
            }
        }

        Object[] pvals = cmd.getParameterData();

        return executeCompiledStatement(cs, pvals);
    }
private Result executeCompiledStatement ( Result cmd ) { Statement cs = cmd . getStatement ( ) ; if ( ! cs . isValid ( ) ) { long csid = cmd . getStatementID ( ) ; cs = database . compiledStatementManager . getStatement ( this , csid ) ; if ( cs == null ) { return Result . newErrorResult ( Error . error ( ErrorCode . X_07502 ) ) ; } } Object [ ] pvals = cmd . getParameterData ( ) ; return executeCompiledStatement ( cs , pvals ) ; }
Retrieves the result of executing the prepared statement whose csid
and parameter values/types are encapsulated by the cmd argument.

@return the result of executing the statement