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

📄 netstatementrequest.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                extdtaPositions_.clear();  // reset extdta column position markers            }            // is this the best place for this (OPNQRY needs this too)            // think about having this method return a boolean to            // indicate the extdta should be built            boolean overrideExists = buildSQLDTAcommandData(numParameters,                    parameterMetaData,                    inputs);            buildEXTDTA(parameterMetaData, inputs, false); // no chained autocommit for CALLs        }        ((NetStatement) materialStatement).qryrowsetSentOnOpnqry_ = sendQryrowset;    }    // Write the message to execute an SQL Set Statement./*  public void writeSetGenericSQLSetInfo (org.apache.derby.client.am.SetGenericSQLSetPiggybackCommand setGenericSQLSetPiggybackCommand,                                  org.apache.derby.client.am.JDBCSection section) throws SqlException  {    buildEXCSQLSET (section);    java.util.List sqlsttList = setGenericSQLSetPiggybackCommand.getList();    for (int i = 0; i < sqlsttList.size(); i++) {      String sql = (String)sqlsttList.get(i);      // Build SQLSTT only for the SET statement that coming from the server after RLSCONV      buildSQLSTTcommandData (sql);    }  }*/    //----------------------helper methods----------------------------------------    // These methods are "private protected", which is not a recognized java privilege,    // but means that these methods are private to this class and to subclasses,    // and should not be used as package-wide friendly methods.    // Build the Open Query Command to open a query to a relational database.    // At SQLAM >= 7 we can request the return of a DA, are there    // scenarios where this should currently be done (it is not supported now)    //    // preconditions:    //   the sqlam and/or prdid must support command and parameters passed to this method,    //   method will not validate against the connection's level of support    //    void buildOPNQRY(Section section,                     boolean sendQueryRowSet,                     int fetchSize) throws SqlException {        createCommand();        markLengthBytes(CodePoint.OPNQRY);        buildPKGNAMCSN(section);        buildQRYBLKSZ();  // specify a hard coded query block size        if (sendQueryRowSet) {            buildMAXBLKEXT(-1);            buildQRYROWSET(fetchSize);        }        updateLengthBytes();  // opnqry is complete    }    // Build the Execute Immediate SQL Statement Command to    // execute a non-cursor SQL statement sent as command data.    //    // precondtions:    void buildEXCSQLIMM(Section section,                        boolean sendQryinsid,                        long qryinsid) throws SqlException {        createCommand();        markLengthBytes(CodePoint.EXCSQLIMM);        buildPKGNAMCSN(section);        buildRDBCMTOK();        if (sendQryinsid) {            buildQRYINSID(qryinsid);        }        updateLengthBytes();    }    // Build the Prepare SQL Statement Command to dynamically binds an    // SQL statement to a section in an existing relational database (RDB) package.    //    // preconditions:    //   the sqlam and/or prdid must support command and parameters passed to this method,    //   method will not validate against the connection's level of support    void buildPRPSQLSTT(Section section,                        String sql,                        boolean sendRtnsqlda,                        boolean sendTypsqlda,                        int typsqlda) throws SqlException {        createCommand();        markLengthBytes(CodePoint.PRPSQLSTT);        buildPKGNAMCSN(section);        if (sendRtnsqlda) {            buildRTNSQLDA();        }        if (sendTypsqlda) {            buildTYPSQLDA(typsqlda);        }        updateLengthBytes();    }    // Build the command to execute an SQL SET Statement.    // Called by NETSetClientPiggybackCommand.write()    //    // preconditions:    //   the sqlam and/or prdid must support command and parameters passed to this method,    //   method will not validate against the connection's level of support    void buildEXCSQLSET(Section section)            throws SqlException {        createCommand();        markLengthBytes(CodePoint.EXCSQLSET);        buildPKGNAMCSN(section);  // is this PKGNAMCSN or PKGNAMCT        updateLengthBytes();    }    // Build the Execute SQL Statement (EXCSQLSTT) Command    // to execute a non-cursor SQL statement previously bound into a named package    // of a relational database (RDB).  The SQL statement can optionally include    // references to input variables, output variables, or both.    //    // At SQLAM >= 7 we can get a DA back on this, are there times that we want to request it    // If so, we probably want to pass a parameter indicating the sqldaLevel requested.    //    // preconditions:    //   the sqlam and/or prdid must support command and parameters passed to this method,    //   method will not validate against the connection's level of support    // Here is the preferred codepoint ordering:    // PKGNAMCSN    // RDBCMTOK    // OUTEXP    // QRYBLKSZ    // MAXBLKEXT    // MAXRSLCNT    // RSLSETFLG    // QRYROWSET    // RTNSQLDA    // TYPSQLDA    // NBRROW    // ATMIND    // PRCNAM    // OUTOVROPT    // RDBNAM    void buildEXCSQLSTT(Section section,                        boolean sendOutexp,                        boolean outexp,                        boolean sendPrcnam,                        String prcnam,                        boolean sendQryblksz,                        boolean sendMaxrslcnt,                        int maxrslcnt,                        boolean sendMaxblkext,                        int maxblkext,                        boolean sendRslsetflg,                        int resultSetFlag,                        boolean sendQryrowset,                        int qryrowset) throws SqlException {        createCommand();        markLengthBytes(CodePoint.EXCSQLSTT);        buildPKGNAMCSN(section);        buildRDBCMTOK();        if (sendOutexp) {            buildOUTEXP(outexp);        }        if (sendQryblksz) {            buildQRYBLKSZ();        }        if (sendQryrowset && sendMaxblkext) {            buildMAXBLKEXT(maxblkext);        }        if (sendMaxrslcnt) {            buildMAXRSLCNT(maxrslcnt);        }        if (sendRslsetflg) {            buildRSLSETFLG(resultSetFlag);        }        if (sendQryrowset) {            buildQRYROWSET(qryrowset);        }        if (sendPrcnam) {            buildPRCNAM(prcnam);        }        updateLengthBytes();  // command is complete, update the length bytes    }    // Build the Describe SQL Statement command.    //    // preconditions:    //   the sqlam and/or prdid must support command and parameters passed to this method,    //   method will not validate against the connection's level of support    void buildDSCSQLSTT(Section section,                        boolean sendTypsqlda,                        int typsqlda) throws SqlException {        createCommand();        markLengthBytes(CodePoint.DSCSQLSTT);        buildPKGNAMCSN(section);        if (sendTypsqlda) {            buildTYPSQLDA(typsqlda);        }        updateLengthBytes();    }    // Build the SQL Program Variable Data Command Data Object.    // This object contains the input data to an SQL statement    // that an RDB is executing.    //    // preconditions:    boolean buildSQLDTAcommandData(int numInputColumns,                                   ColumnMetaData parameterMetaData,                                   Object[] inputRow) throws SqlException {        createEncryptedCommandData();        int loc = offset_;        markLengthBytes(CodePoint.SQLDTA);        int[][] protocolTypesAndLengths = allocateLidAndLengthsArray(parameterMetaData);        java.util.Hashtable protocolTypeToOverrideLidMapping = null;        java.util.ArrayList mddOverrideArray = null;        protocolTypeToOverrideLidMapping =                computeProtocolTypesAndLengths(inputRow, parameterMetaData, protocolTypesAndLengths,                        protocolTypeToOverrideLidMapping);        boolean overrideExists = false;        buildFDODSC(numInputColumns,                protocolTypesAndLengths,                overrideExists,                protocolTypeToOverrideLidMapping,                mddOverrideArray);        buildFDODTA(numInputColumns,                protocolTypesAndLengths,                inputRow);        updateLengthBytes(); // for sqldta        if (netAgent_.netConnection_.getSecurityMechanism() ==                NetConfiguration.SECMEC_EUSRIDDTA ||                netAgent_.netConnection_.getSecurityMechanism() ==                NetConfiguration.SECMEC_EUSRPWDDTA) {            encryptDataStream(loc);        }        return overrideExists;    }    // Build the FDOCA Data Descriptor Scalar whose value is a FDOCA    // Descriptor or a segment of an FDOCA Descriptor.    //    // preconditions:    private void buildFDODSC(int numColumns,                             int[][] protocolTypesAndLengths,                             boolean overrideExists,                             java.util.Hashtable overrideMap,                             java.util.ArrayList overrideArray) throws SqlException {        markLengthBytes(CodePoint.FDODSC);        buildSQLDTA(numColumns, protocolTypesAndLengths, overrideExists, overrideMap, overrideArray);        updateLengthBytes();    }    // Build the FDOCA SQLDTA Late Row Descriptor.    //    // preconditions:    protected void buildSQLDTA(int numColumns,                               int[][] lidAndLengthOverrides,                               boolean overrideExists,                               java.util.Hashtable overrideMap,                               java.util.ArrayList overrideArray) throws SqlException {        // mdd overrides need to be built first if any before the descriptors are built.        if (overrideExists) {            buildMddOverrides(overrideArray);            writeBytes(FdocaConstants.MDD_SQLDTAGRP_TOSEND);

⌨️ 快捷键说明

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