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

📄 netstatementreply.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                checkPreviousSQLDTARDtriplet(previousTripletType,                        FdocaConstants.SQLDTARD_TRIPLET_TYPE_SDA,                        previousTripletId,                        FdocaConstants.SQLDTARD_TRIPLET_ID_SDA);                previousTripletType = FdocaConstants.SQLDTARD_TRIPLET_TYPE_SDA;                previousTripletId = FdocaConstants.SQLDTARD_TRIPLET_ID_SDA;                netAgent_.targetTypdef_.setMddOverride(mddProtocolType, // mdd protocol type                        tripletId, // fdocaTripletLid                        readFastUnsignedByte(), // fdocaFieldType                        readFastInt(), // ccsid                        readFastUnsignedByte(), // characterSize                        readFastUnsignedByte(), // mode                        readFastShort());                break;            default:                descriptorErrorDetected();  //DSCERRCD_01                break;            }            ddmLength -= tripletLength;        }        adjustLengths(getDdmLength());        // Allocate a char buffer after all of the descriptors have been parsed out.        cursor.allocateCharBuffer();        checkPreviousSQLDTARDtriplet(previousTripletType,                FdocaConstants.SQLDTARD_TRIPLET_TYPE_END,                previousTripletId,                FdocaConstants.SQLDTARD_TRIPLET_ID_END);    }    private void checkPreviousSQLDTARDtriplet(int previousTripletType,                                              int tripletType,                                              int previousTripletId,                                              int tripletId) throws DisconnectException {        if (FdocaConstants.SQLDTARD_TRIPLET_TYPES[previousTripletType][tripletType] == false) {            descriptorErrorDetected(); // DSCERRCD_02 move error identity into array        }        if (FdocaConstants.SQLDTARD_TRIPLET_IDS[previousTripletId][tripletId] == false) {            descriptorErrorDetected(); // DSCERRCD_02 move error identity into array        }    }    private void checkFastRLO(int[][] rlo) throws DisconnectException {        for (int i = 0; i < rlo.length; i++) {            int lid = readFastUnsignedByte();            if (lid != rlo[i][FdocaConstants.RLO_GROUP_LID]) {                descriptorErrorDetected(); // DSCERRCD_42            }            int elementTaken = readFastUnsignedByte();            if (elementTaken != rlo[i][FdocaConstants.RLO_ELEMENT_TAKEN]) {                descriptorErrorDetected();  // DSCERRCD_07            }            int repFactor = readFastUnsignedByte();            if (repFactor != rlo[i][FdocaConstants.RLO_REP_FACTOR]) {                descriptorErrorDetected();  // DSCERRCD_07            }        }    }    // Possible errors to detect include:    // DSCERRCD_01 - FDOCA triplet is not used in PROTOCOL descriptors or type code is invalid    // DSCERRCD_02 - FDOCA triplet sequence error    // DSCERRCD_03 - An array description is required and this is not one    //               (too many or too few RLO triplets)    // DSCERRCD_04 - A row description is required and this is not one    //               (too many or too few RLO triplets)    // DSCERRCD_05 - Late Environmental Descriptor just received not supported    // DSCERRCD_06 - Malformed triplet, required parameter is missing    // DSCERRCD_07 - Parameter value is not acceptable    // DSCERRCD_11 - MDD present is not recognized as an SQL descriptor    // DSCERRCD_12 - MDD class is not recognized as a valid SQL class    // DSCERRCD_13 - MDD type not recognized as a valid SQL type    // DSCERRCD_21 - Representation is incompatible with SQL type (in prior MDD)    // DSCERRCD_22 - CCSID is not supported    // DSCERRCD_32 - GDA references a local identifier which is not an SDA or GDA    // DSCERRCD_33 - GDA length override exceeds limits    // DSCERRCD_34 - GDA precision exceeds limits    // DSCERRCD_35 - GDA scale greater than precision or scale negative    // DSCERRCD_36 - GDA length override missing or incompatible with data type    // DSCERRCD_41 - RLO references a LID which is not an RLO or GDA.    // DSCERRCD_42 - RLO fails to reference a required GDA or RLO.    private void descriptorErrorDetected() throws DisconnectException {        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                "Execution failed due to a distribution protocol error that caused " +                "deallocation of the conversation.  " +                "A PROTOCOL Invalid FDOCA Description Error was detected.",                SqlState._58009));    }    protected void parseQRYDTA(NetResultSet netResultSet) throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.QRYDTA);        if (longValueForDecryption_ == null) {            int ddmLength = getDdmLength();            ensureBLayerDataInBuffer(ddmLength);        }        parseSQLDTARDdata(netResultSet.netCursor_);        if (longValueForDecryption_ == null) {            adjustLengths(getDdmLength());        } else {            longValueForDecryption_ = null;        }        if (longBufferForDecryption_ != null) {            buffer_ = longBufferForDecryption_;            pos_ = longPosForDecryption_;            if (count_ > longBufferForDecryption_.length) {                count_ = longBufferForDecryption_.length;            } else if (longCountForDecryption_ != 0) {                count_ = longCountForDecryption_;                longCountForDecryption_ = 0;            }            dssLength_ = 0;            longBufferForDecryption_ = null;        }    }    NetSqlca parseFDODTA(NetCursor netCursor) throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.FDODTA);        int ddmLength = getDdmLength();        ensureBLayerDataInBuffer(ddmLength);        mark();        NetSqlca netSqlca = parseSQLCARDrow(null);        int length = getFastSkipSQLCARDrowLength();        adjustLengths(length);        parseFastSQLDTARDdata(netCursor);        return netSqlca;    }    void parseFastSQLDTARDdata(NetCursor netCursor) throws DisconnectException {        netCursor.dataBufferStream_ = getFastData(netCursor.dataBufferStream_);        netCursor.dataBuffer_ = netCursor.dataBufferStream_.toByteArray();        netCursor.lastValidBytePosition_ = netCursor.dataBuffer_.length;    }    void parseSQLDTARDdata(NetCursor netCursor) throws DisconnectException {        if (longValueForDecryption_ == null) {            netCursor.dataBufferStream_ = getData(netCursor.dataBufferStream_);            netCursor.dataBuffer_ = netCursor.dataBufferStream_.toByteArray();        } else {            int size = netCursor.dataBufferStream_.size();            if (size == 0) {                netCursor.dataBuffer_ = longValueForDecryption_;                //longValue_ = null;            } else {                byte[] newArray = new byte[size + longValueForDecryption_.length];                System.arraycopy(netCursor.dataBuffer_, 0, newArray, 0, size);                System.arraycopy(longValueForDecryption_, 0, newArray, size, longValueForDecryption_.length);                netCursor.dataBuffer_ = newArray;                //longValue_ = null;            }        }        netCursor.lastValidBytePosition_ = netCursor.dataBuffer_.length;    }    protected void copyEXTDTA(NetCursor netCursor) throws DisconnectException {        try {            parseLengthAndMatchCodePoint(CodePoint.EXTDTA);            byte[] data = null;            if (longValueForDecryption_ == null) {                data = (getData(null)).toByteArray();            } else {                data = longValueForDecryption_;                dssLength_ = 0;                longValueForDecryption_ = null;            }            netCursor.extdtaData_.add(data);        } catch (java.lang.OutOfMemoryError e) {            agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                    "Attempt to fully materialize lob data that is too large for the JVM.  "));        }    }    //------------------------parse DDM Scalars-----------------------------    // RDB Package name, consistency token, and section number    // specifies the fully qualified name of a relational    // database package, its consistency token, and a specific    // section within a package.    //    // Only called for generated secctions from a callable statement.    //    protected Object parsePKGNAMCSN(boolean skip) throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.PKGNAMCSN);        if (skip) {            skipBytes();            return null;        }        // Still need to populate the logical members in case of an "set current packageset"        String rdbnam = null;        String rdbcolid = null;        String pkgid = null;        byte[] pkgcnstkn = null;        int pkgsn = 0;        byte[] pkgnamcsnBytes = null;        int pkgnamcsnLength = 0;        int ddmLength = getDdmLength();        int offset = 0;        ensureBLayerDataInBuffer(ddmLength);        if (ddmLength == 64) {            // read all the bytes except the section number into the byte[] for caching            pkgnamcsnLength = ddmLength - 2;            //pkgnamcsnBytes = readBytes (pkgnamcsnLength);            pkgnamcsnBytes = new byte[pkgnamcsnLength];            // readFast() does a read without moving the read head.            offset = peekFastBytes(pkgnamcsnBytes, offset, pkgnamcsnLength);            // populate the logical members            rdbnam = readFastString(18);   // RDB name            rdbcolid = readFastString(18); // RDB Collection ID            pkgid = readFastString(18);    // RDB Package ID            pkgcnstkn = readFastBytes(8);  // Package Consistency Token        } else if ((ddmLength >= 71) && (ddmLength <= 781)) {            // this is the new SCLDTA format.            // new up a byte[] to cache all the bytes except the 2-byte section number            pkgnamcsnBytes = new byte[ddmLength - 2];            // get rdbnam            int scldtaLen = peekFastLength();            if (scldtaLen < 18 || scldtaLen > 255) {                agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                        "scldta length, " + scldtaLen + ", is invalid for rdbnam"));                return null;            }            // read 2+scldtaLen number of bytes from the reply buffer into the pkgnamcsnBytes            //offset = readBytes (pkgnamcsnBytes, offset, 2+scldtaLen);            offset = peekFastBytes(pkgnamcsnBytes, offset, 2 + scldtaLen);            skipFastBytes(2);            rdbnam = readFastString(scldtaLen);            // get rdbcolid            scldtaLen = peekFastLength();            if (scldtaLen < 18 || scldtaLen > 255) {                agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                        "scldta length, " + scldtaLen + ", is invalid for rdbcolid"));                return null;            }            // read 2+scldtaLen number of bytes from the reply buffer into the pkgnamcsnBytes            offset = peekFastBytes(pkgnamcsnBytes, offset, 2 + scldtaLen);            skipFastBytes(2);            rdbcolid = readFastString(scldtaLen);            // get pkgid            scldtaLen = peekFastLength();            if (scldtaLen < 18 || scldtaLen > 255) {                agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                        "scldta length, " + scldtaLen + ", is invalid for pkgid"));                return null; // To make compiler happy.            }            // read 2+scldtaLen number of bytes from the reply buffer into the pkgnamcsnBytes            offset = peekFastBytes(pkgnamcsnBytes, offset, 2 + scldtaLen);            skipFastBytes(2);            pkgid = readFastString(scldtaLen);            // get consistency token            offset = peekFastBytes(pkgnamcsnBytes, offset, 8);            pkgcnstkn = readFastBytes(8);        } else {            agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,                    "PKGNAMCSN length, " + ddmLength + ", is invalid at SQLAM " + netAgent_.targetSqlam_));            return null;  // To make compiler happy.        }        pkgsn = readFastUnsignedShort();  // Package Section Number.        adjustLengths(ddmLength);        // this is a server generated section        // the -1 is set for holdability and it is not used for generated sections        Section section = new Section(this.agent_, pkgid, pkgsn, null, -1, true);        section.setPKGNAMCBytes(pkgnamcsnBytes);        return section;    }    // Query Protocol type specifies the type of query protocol    // the target SQLAM uses.    protected int parseQRYPRCTYP() throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.QRYPRCTYP);        int qryprctyp = parseCODPNTDR();        if ((qryprctyp != CodePoint.FIXROWPRC) && (qryprctyp != CodePoint.LMTBLKPRC)) {            doValnsprmSemantics(CodePoint.QRYPRCTYP, qryprctyp);        }        return qryprctyp;    }    protected int parseFastQRYPRCTYP() throws DisconnectException {        matchCodePoint(CodePoint.QRYPRCTYP);        int qryprctyp = readFastUnsignedShort();        if ((qryprctyp != CodePoint.FIXROWPRC) && (qryprctyp != CodePoint.LMTBLKPRC)) {            doValnsprmSemantics(CodePoint.QRYPRCTYP, qryprctyp);        }        return qryprctyp;    }    // hold cursor position state indicates whether the requester specified    // the HOLD option on the SQL DECLARE CURSOR statement.  When the HOLD    // option is specified, the cursor is not closed upon execution of a    // commit operation.    // The value TRUE indicates that the requester specifies the HOLD    // operation.  The value FALSSE indicates that the requeter is not    // specifying the HOLD option.    protected int parseSQLCSRHLD() throws DisconnectException {        parseLengthAndMatchCodePoint(CodePoint.SQLCSRHLD);        int sqlcsrhld = readUnsignedByte();        // 0xF0 is false (defau

⌨️ 快捷键说明

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