⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netstatementreply.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
            if (peekCP == CodePoint.SVRCOD) {                foundInPass = true;                svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);                svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR, CodePoint.SVRCOD_ERROR);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.RDBNAM) {                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.PKGNAMCSN) {                foundInPass = true;                pkgnamcsnReceived = checkAndGetReceivedFlag(pkgnamcsnReceived);                pkgnamcsn = parsePKGNAMCSN(true);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived,                rdbnamReceived,                pkgnamcsnReceived);        netAgent_.setSvrcod(svrcod);        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                "Execution failed due to a distribution protocol error that caused " +                "deallocation of the conversation.  " +                "An Open Query Command was issued for a query which was already open.",                SqlState._58009));    }    // Open Query Failure (OPNQFLRM) Reply Message indicates that the    // OPNQRY command failed to open the query.  The reason that the    // target relational database was unable to open the query is reported in an    // SQLCARD reply data object.    // Whenever an OPNQFLRM is returned, an SQLCARD object must also be returned    // following the OPNQFLRM.    //    // Returned from Server:    //   SVRCOD - required (8 - ERROR)    //   RDBNAM - required    //   SRVDGN - optional    private void parseOPNQFLRM(StatementCallbackInterface statement) throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean rdbnamReceived = false;        String rdbnam = null;        parseLengthAndMatchCodePoint(CodePoint.OPNQFLRM);        pushLengthOnCollectionStack();        int peekCP = peekCodePoint();        while (peekCP != Reply.END_OF_COLLECTION) {            boolean foundInPass = false;            if (peekCP == CodePoint.SVRCOD) {                foundInPass = true;                svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);                svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR, CodePoint.SVRCOD_ERROR);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.RDBNAM) {                // skip the rdbnam since it doesn't tell us anything new.                // there is no way to return it to the application anyway.                // not having to convert this to a string is a time saver also.                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived, rdbnamReceived);        netAgent_.setSvrcod(svrcod);        // get SQLSTATE from SQLCARD...    }    // RDB Result Set Reply Message (RSLSETRM) indicates that an    // EXCSQLSTT command invoked a stored procedure, that the execution    // of the stored procedure generated one or more result sets, and    // additional information aobut these result sets follows the SQLCARD and    // SQLDTARD in the reply data of the response    //    // Returned from Server:    //   SVRCOD - required  (0 INFO)    //   PKGSNLST - required    //   SRVDGN - optional    protected java.util.ArrayList parseRSLSETRM() throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean pkgsnlstReceived = false;        java.util.ArrayList pkgsnlst = null;        parseLengthAndMatchCodePoint(CodePoint.RSLSETRM);        pushLengthOnCollectionStack();        int peekCP = peekCodePoint();        while (peekCP != Reply.END_OF_COLLECTION) {            boolean foundInPass = false;            if (peekCP == CodePoint.SVRCOD) {                foundInPass = true;                svrcodReceived = checkAndGetReceivedFlag(svrcodReceived);                svrcod = parseSVRCOD(CodePoint.SVRCOD_INFO, CodePoint.SVRCOD_INFO);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.PKGSNLST) {                // contain repeatable PKGNAMCSN                foundInPass = true;                pkgsnlstReceived = checkAndGetReceivedFlag(pkgsnlstReceived);                pkgsnlst = parsePKGSNLST();                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived, pkgsnlstReceived);        netAgent_.setSvrcod(svrcod);        return pkgsnlst;    }    //--------------------- parse DDM Reply Data--------------------------------------    // SQL Data Reply Data consists of output data from the relational database (RDB)    // processing of an SQL statement.  It also includes a description of the data.    //    // Returned from Server:    //   FDODSC - required    //   FDODTA - required    protected NetSqlca parseSQLDTARD(NetSqldta netSqldta) throws DisconnectException {        boolean fdodscReceived = false;        boolean fdodtaReceived = false;        parseLengthAndMatchCodePoint(CodePoint.SQLDTARD);        pushLengthOnCollectionStack();        NetSqlca netSqlca = null;        int peekCP = peekCodePoint();        while (peekCP != Reply.END_OF_COLLECTION) {            boolean foundInPass = false;            if (peekCP == CodePoint.FDODSC) {                foundInPass = true;                fdodscReceived = checkAndGetReceivedFlag(fdodscReceived);                parseFDODSC(netSqldta);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.FDODTA) {                foundInPass = true;                fdodtaReceived = checkAndGetReceivedFlag(fdodtaReceived);                netSqlca = parseFDODTA(netSqldta);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(fdodscReceived, fdodtaReceived);        netSqldta.calculateColumnOffsetsForRow();        return netSqlca;    }    protected void parseQRYDSC(NetCursor cursor) throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.QRYDSC);        parseSQLDTARDarray(cursor, false); // false means don't just skip the bytes    }    private void parseFDODSC(NetCursor cursor) throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.FDODSC);        parseSQLDTARDarray(cursor, false); // false means don't just skip the bytes    }    private void parseSQLDTARDarray(NetCursor cursor, boolean skipBytes) throws DisconnectException {        if (skipBytes) {            skipBytes();        }        int previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_START;        int previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_START;        int mddProtocolType = 0;        int columnCount = 0;        netAgent_.targetTypdef_.clearMddOverrides();        int ddmLength = getDdmLength();        ensureBLayerDataInBuffer(ddmLength);        while (ddmLength > 0) {            int tripletLength = readFastUnsignedByte();            int tripletType = readFastUnsignedByte();            int tripletId = readFastUnsignedByte();            switch (tripletType) {            case FdocaConstants.MDD_TRIPLET_TYPE:                if ((tripletLength != FdocaConstants.MDD_TRIPLET_SIZE) ||                        (tripletId != FdocaConstants.NULL_LID)) {                    descriptorErrorDetected();                }                checkPreviousSQLDTARDtriplet(previousTripletType,                        FdocaConstants.SQLDTARD_TRIPLET_TYPE_MDD,                        previousTripletId,                        FdocaConstants.SQLDTARD_TRIPLET_ID_0);                previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_MDD;                previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_0;                // read in remaining MDD bytes                int mddClass = readFastUnsignedByte();                int mddType = readFastUnsignedByte();                int mddRefType = readFastUnsignedByte();                mddProtocolType = readFastUnsignedByte();                break;            case FdocaConstants.NGDA_TRIPLET_TYPE: // rename to NGDA_TRIPLET_CODEPOINT                if (tripletId != FdocaConstants.SQLDTAGRP_LID) {                    descriptorErrorDetected();                }                checkPreviousSQLDTARDtriplet(previousTripletType,                        FdocaConstants.SQLDTARD_TRIPLET_TYPE_GDA,                        previousTripletId,                        FdocaConstants.SQLDTARD_TRIPLET_ID_D0);                previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_GDA;                previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_0;                // add a quick check to see if the table is altered (columns are added or deleted)                // before reusing the cached cursor.  note: this check does not catch the case                // where the number of columns stay the same, but the column type or length changes,                // i.e. from integer to char.                int columns = peekTotalColumnCount(tripletLength);                // peek ahead to get the total number of columns.                cursor.initializeColumnInfoArrays(netAgent_.targetTypdef_, columns, netAgent_.targetSqlam_);                columnCount += parseSQLDTAGRPdataLabelsAndUpdateColumn(cursor, columnCount, tripletLength);                break;            case FdocaConstants.RLO_TRIPLET_TYPE:  // rename to RLO_TRIPLET_CODEPOINT                switch (tripletId) {                case FdocaConstants.SQLCADTA_LID:                    if (tripletLength != FdocaConstants.SQLCADTA_RLO_SIZE) {                        descriptorErrorDetected(); // DSCERRCD_06                    }                    checkPreviousSQLDTARDtriplet(previousTripletType,                            FdocaConstants.SQLDTARD_TRIPLET_TYPE_RLO,                            previousTripletId,                            FdocaConstants.SQLDTARD_TRIPLET_ID_E0);                    previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_RLO;                    previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_E0;                    checkFastRLO(FdocaConstants.RLO_SQLCADTA);                    break;                case FdocaConstants.SQLDTARD_LID:                    if (tripletLength != FdocaConstants.SQLDTARD_RLO_SIZE) {                        descriptorErrorDetected(); // DSCERRCD_06                    }                    checkPreviousSQLDTARDtriplet(previousTripletType,                            FdocaConstants.SQLDTARD_TRIPLET_TYPE_RLO,                            previousTripletId,                            FdocaConstants.SQLDTARD_TRIPLET_ID_F0);                    previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_RLO;                    previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_F0;                    checkFastRLO(FdocaConstants.RLO_SQLDTARD);                    break;                default:                    descriptorErrorDetected(); // DSCERRCD_07                    break;                }                break;            case FdocaConstants.CPT_TRIPLET_TYPE:  // rename to CPT_TRIPLET_CODEPOINT                if (tripletId != FdocaConstants.NULL_LID) {                    descriptorErrorDetected();                }                checkPreviousSQLDTARDtriplet(previousTripletType,                        FdocaConstants.SQLDTARD_TRIPLET_TYPE_CPT,                        previousTripletId,                        FdocaConstants.SQLDTARD_TRIPLET_ID_0);                previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_CPT;                previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_0;                columnCount += parseSQLDTAGRPdataLabelsAndUpdateColumn(cursor, columnCount, tripletLength);                break;            case FdocaConstants.SDA_TRIPLET_TYPE:  // rename to SDA_TRIPLET_CODEPOINT                if (tripletLength != FdocaConstants.SDA_TRIPLET_SIZE) {                    descriptorErrorDetected();  // DSCERRCD_06                }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -