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

📄 netconnectionreply.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
    // Returned from Server:    //   SVRCOD - required  (4 WARNING)    //   UOWDSP - required    //   RDBNAM - optional    void parseENDUOWRM(ConnectionCallbackInterface connection) throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean uowdspReceived = false;        int uowdsp = 0;        boolean rdbnamReceived = false;        String rdbnam = null;        parseLengthAndMatchCodePoint(CodePoint.ENDUOWRM);        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_WARNING, CodePoint.SVRCOD_WARNING);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.UOWDSP) {                foundInPass = true;                uowdspReceived = checkAndGetReceivedFlag(uowdspReceived);                uowdsp = parseUOWDSP();                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.RDBNAM) {                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived, uowdspReceived);        netAgent_.setSvrcod(svrcod);        if (uowdsp == CodePoint.UOWDSP_COMMIT) {            connection.completeLocalCommit();        } else {            connection.completeLocalRollback();        }    }    // Command Check Reply Message indicates that the requested    // command encountered an unarchitected and implementation-specific    // condition for which there is no architected message.  If the severity    // code value is ERROR or greater, the command has failed.  The    // message can be accompanied by other messages that help to identify    // the specific condition.    // The CMDCHKRM should not be used as a general catch-all in place of    // product-defined messages when using product extensions to DDM.    // PROTOCOL architects the SQLSTATE value depending on SVRCOD    // SVRCOD 0 -> SQLSTATE is not returned    // SVRCOD 8 -> SQLSTATE of 58008 or 58009    // SVRCOD 16,32,64,128 -> SQLSTATE of 58009    //    // Messages    //   SQLSTATE : 58009    //     Execution failed due to a distribution protocol error that caused deallocation of the conversation.    //     SQLCODE : -30020    //     Execution failed because of a Distributed Protocol    //       Error that will affect the successful execution of subsequent    //       commands and SQL statements: Reason Code <reason-code>.    //     Some possible reason codes include:    //       121C Indicates that the user is not authorized to perform the requested command.    //       1232 The command could not be completed because of a permanent error.    //         In most cases, the server will be in the process of an abend.    //       220A The target server has received an invalid data description.    //         If a user SQLDA is specified, ensure that the fields are    //         initialized correctly. Also, ensure that the length does not    //         exceed the maximum allowed length for the data type being used.    //    // The command or statement cannot be processed.  The current    // transaction is rolled back and the application is disconnected    //  from the remote database.    //    //    // Returned from Server:    //   SVRCOD - required  (0 - INFO, 4 - WARNING, 8 - ERROR, 16 - SEVERE,    //                       32 - ACCDMG, 64 - PRMDMG, 128 - SESDMG))    //   RDBNAM - optional (MINLVL 3)    //   RECCNT - optional (MINVAL 0, MINLVL 3)    //    // Called by all the Reply classesCMDCHKRM    protected void parseCMDCHKRM() throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean rdbnamReceived = false;        String rdbnam = null;        parseLengthAndMatchCodePoint(CodePoint.CMDCHKRM);        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_SESDMG);                peekCP = peekCodePoint();            }            if (peekCP == CodePoint.RDBNAM) {                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            // skip over the RECCNT since it can't be found in the DDM book.            if (peekCP == 0x115C) {                foundInPass = true;                parseLengthAndMatchCodePoint(0x115C);                skipBytes();                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived);        netAgent_.setSvrcod(svrcod);        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                "Execution failed due to a distribution protocol error that caused " +                "deallocation of the conversation.  " +                "The requested command encountered an unarchitected and implementation " +                "specific condition for which there was no architected message.",                SqlState._58009));    }    // RDB Not Accessed Reply Message indicates that the access relational    // database command (ACCRDB) was not issued prior to a command    // requesting the RDB Services.    // PROTOCOL Architects an SQLSTATE of 58008 or 58009.    //    // Messages    // SQLSTATE : 58009    //     Execution failed due to a distribution protocol error that caused deallocation of the conversation.    //     SQLCODE : -30020    //     Execution failed because of a Distributed Protocol    //         Error that will affect the successful execution of subsequent    //         commands and SQL statements: Reason Code <reason-code>.    //      Some possible reason codes include:    //      121C Indicates that the user is not authorized to perform the requested command.    //      1232 The command could not be completed because of a permanent error.    //          In most cases, the server will be in the process of an abend.    //      220A The target server has received an invalid data description.    //          If a user SQLDA is specified, ensure that the fields are    //          initialized correctly. Also, ensure that the length does not    //          exceed the maximum allowed length for the data type being used.    //    //      The command or statement cannot be processed.  The current    //      transaction is rolled back and the application is disconnected    //      from the remote database.    //    //    // Returned from Server:    // SVRCOD - required  (8 - ERROR)    // RDBNAM - required    //    // Called by all the NET*Reply classes.    void parseRDBNACRM() throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean rdbnamReceived = false;        String rdbnam = null;        parseLengthAndMatchCodePoint(CodePoint.RDBNACRM);        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) {                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived, rdbnamReceived);        netAgent_.setSvrcod(svrcod);        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                "Execution failed due to a distribution protocol error that caused " +                "deallocation of the conversation.  " +                "The access relational database command was not issued prior to " +                "a command requesting RDB services.  ",                SqlState._58009));    }    // RDB Not Found Reply Message indicates that the target    // server cannot find the specified relational database.    // PROTOCOL architects an SQLSTATE of 08004.    //    // Messages    // SQLSTATE : 8004    //     The application server rejected establishment of the connection.    //     SQLCODE : -30061    //     The database alias or database name <name> was not found at the remote node.    //     The statement cannot be processed.    //    //    // Returned from Server:    // SVRCOD - required  (8 - ERROR)    // RDBNAM - required    //    private void parseRDBNFNRM(NetConnection netConnection) throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean rdbnamReceived = false;        String rdbnam = null;        parseLengthAndMatchCodePoint(CodePoint.RDBNFNRM);        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) {                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived, rdbnamReceived);        netAgent_.setSvrcod(svrcod);        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                "The application server rejected establishment of the connection.  " +                "An attempt was made to access a database, " +                netConnection.databaseName_ + ", which was not found.",                SqlState._08004));    }    // Not Authorized to RDB Reply Message specifies that    // the requester is not authorized to access the specified    // relational database.    // PROTOCOL architects an SQLSTATE of 08004    //    // Messages    // SQLSTATE : 8004    //     Authorization ID <authorization-ID> attempted to perform the specified    //     <operation> without having been granted the proper authorization to do so.    //     SQLCODE : -30060    //      <authorization-ID> does not have the privilege to perform operation <operation>.    //    //    // Returned from Server:    // SVRCOD - required  (8 - ERROR)    // RDBNAM - required    //    private void parseRDBATHRM(NetConnection netConnection) throws DisconnectException {        boolean svrcodReceived = false;        int svrcod = CodePoint.SVRCOD_INFO;        boolean rdbnamReceived = false;        String rdbnam = null;        parseLengthAndMatchCodePoint(CodePoint.RDBATHRM);        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) {                foundInPass = true;                rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived);                rdbnam = parseRDBNAM(true);                peekCP = peekCodePoint();            }            if (!foundInPass) {                doPrmnsprmSemantics(peekCP);            }        }        popCollectionStack();        checkRequiredObjects(svrcodReceived, rdbnamReceived);        netAgent_.setSvrcod(svrcod);        netAgent_.accumulateReadException(new SqlException(agent_.logWriter_,                "The application server rejected establishment of the connection.  " +

⌨️ 快捷键说明

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