📄 netstatementreply.java
字号:
copyEXTDTA(netSqldta); peekCP = peekCodePoint(); } statementI.completeExecuteCall(netSqlca, netSqldta); } else { // if here, then assume an error reply message was returned. parseExecuteError(statementI); } } protected void parseResultSetProcedure(StatementCallbackInterface statementI) throws DisconnectException { // when a stored procedure is called which returns result sets, // the next thing to be returned after the optional transaction component // is the summary component. // // Parse the Result Set Summary Component which consists of a // Result Set Reply Message, SQLCARD or SQLDTARD, and an SQL Result Set // Reply data object. Also check for possible TYPDEF overrides before the // OBJDSSs. // This method returns an ArrayList of generated sections which contain the // package and section information for the result sets which were opened on the // server. // the result set summary component consists of a result set reply message. java.util.ArrayList sectionAL = parseRSLSETRM(); // following the RSLSETRM is an SQLCARD or an SQLDTARD. check for a // TYPDEFNAM or TYPDEFOVR before looking for these objects. int peekCP = parseTypdefsOrMgrlvlovrs(); // The SQLCARD and the SQLDTARD are mutually exclusive. // The SQLDTARD is returned if the stored procedure had parameters. // (Note: the SQLDTARD contains an sqlca also. this is the sqlca for the // stored procedure call. NetSqldta netSqldta = null; NetSqlca netSqlca = null; if (peekCP == CodePoint.SQLCARD) { netSqlca = parseSQLCARD(null); } else { // keep the PreparedStatementCallbackInterface, since only preparedstatement and callablestatement // has parameters or singleton select which translates to sqldtard. netSqldta = new NetSqldta(netAgent_); netSqlca = parseSQLDTARD(netSqldta); } // check for a possible TYPDEFNAM or TYPDEFOVR // before the SQL Result Set Reply Data object peekCP = parseTypdefsOrMgrlvlovrs(); int numberOfResultSets = parseSQLRSLRD(sectionAL); // The result set summary component parsed above indicated how many result sets were opened // by the stored pocedure call. It contained section information for // each of these result sets. Loop through the section array and // parse the result set component for each of the retunred result sets. NetResultSet[] resultSets = new NetResultSet[numberOfResultSets]; for (int i = 0; i < numberOfResultSets; i++) { // parse the result set component of the stored procedure reply. NetResultSet netResultSet = parseResultSetCursor(statementI, (Section) sectionAL.get(i)); resultSets[i] = netResultSet; } // LOBs may have been returned for one of the stored procedure parameters so // check for any externalized data. peekCP = peekCodePoint(); while (peekCP == CodePoint.EXTDTA) { copyEXTDTA(netSqldta); peekCP = peekCodePoint(); } statementI.completeExecuteCall(netSqlca, netSqldta, resultSets); } // Parse the Result Set component of the reply for a stored procedure // call which returns result sets. // The Result Set component consists of an Open Query Reply Message // followed by an optional SQLCARD, followed by an optional // SQL Column Information Reply data object, followed by a Query Descriptor. // There may also be Query Data or an End of Query Reply Message. protected NetResultSet parseResultSetCursor(StatementCallbackInterface statementI, Section section) throws DisconnectException { // The first item returne is an OPNQRYRM. NetResultSet netResultSet = parseOPNQRYRM(statementI); // The next to be returned is an OBJDSS so check for any TYPDEF overrides. int peekCP = parseTypdefsOrMgrlvlovrs(); // An SQLCARD may be returned if there were any warnings on the OPEN. NetSqlca netSqlca = null; if (peekCP == CodePoint.SQLCARD) { netSqlca = parseSQLCARD(null); peekCP = parseTypdefsOrMgrlvlovrs(); } // the SQLCINRD contains SQLDA like information for the result set. ColumnMetaData resultSetMetaData = null; if (peekCP == CodePoint.SQLCINRD) { resultSetMetaData = parseSQLCINRD(); peekCP = parseTypdefsOrMgrlvlovrs(); } // A Query Descriptor must be present. // We cannot cache the cursor if result set is returned from a stored procedure, so // there is no cached cursor to use here. parseQRYDSC(netResultSet.netCursor_); peekCP = peekCodePoint(); statementI.completeExecuteCallOpenQuery(netSqlca, netResultSet, resultSetMetaData, section); // Depending on the blocking rules, QRYDTA may have been returned on the open. while (peekCP == CodePoint.QRYDTA) { parseQRYDTA(netResultSet); peekCP = peekCodePoint(); } // Under some circumstances, the server may have closed the cursor. // This will be indicated by an ENDQRYRM. if (peekCP == CodePoint.ENDQRYRM) { parseEndQuery((ResultSetCallbackInterface) netResultSet); } return netResultSet; } protected void parseOpenQuery(StatementCallbackInterface statementI) throws DisconnectException { NetResultSet netResultSet = parseOPNQRYRM(statementI); NetSqlca sqlca = null; int peekCP = peekCodePoint(); if (peekCP != CodePoint.QRYDSC) { peekCP = parseTypdefsOrMgrlvlovrs(); if (peekCP == CodePoint.SQLDARD) { ColumnMetaData columnMetaData = new ColumnMetaData(netAgent_.logWriter_); NetSqlca netSqlca = parseSQLDARD(columnMetaData, false); // false means do not skip SQLDARD bytes //For java stored procedure, we got the resultSetMetaData from server, //Do we need to save the resultSetMetaData and propagate netSqlca? //The following statement are doing the both, but it do more than //we want. It also mark the completion of Prepare statement. // // this will override the same call made from parsePrepareDescribe // this will not work, this is not the DA for the stored proc params statementI.completePrepareDescribeOutput(columnMetaData, netSqlca); peekCP = parseTypdefsOrMgrlvlovrs(); } // check if the DARD is mutually exclusive with CARD, if so, then the following if should be an elese if (peekCP == CodePoint.SQLCARD) { sqlca = parseSQLCARD(null); peekCP = parseTypdefsOrMgrlvlovrs(); } } parseQRYDSC(netResultSet.netCursor_); peekCP = peekCodePoint(); while (peekCP == CodePoint.QRYDTA) { parseQRYDTA(netResultSet); peekCP = peekCodePoint(); } if (peekCP == CodePoint.SQLCARD) { NetSqlca netSqlca = parseSQLCARD(null); statementI.completeSqlca(netSqlca); peekCP = peekCodePoint(); } if (peekCP == CodePoint.ENDQRYRM) { parseEndQuery(netResultSet); } statementI.completeOpenQuery(sqlca, netResultSet); } protected void parseEndQuery(ResultSetCallbackInterface resultSetI) throws DisconnectException { parseENDQRYRM(resultSetI); parseTypdefsOrMgrlvlovrs(); NetSqlca netSqlca = parseSQLCARD(null); resultSetI.earlyCloseComplete(netSqlca); } void parseOpenQueryFailure(StatementCallbackInterface statementI) throws DisconnectException { parseOPNQFLRM(statementI); parseTypdefsOrMgrlvlovrs(); NetSqlca netSqlca = parseSQLCARD(null); statementI.completeOpenQuery(netSqlca, null); } void parsePrepareError(StatementCallbackInterface statement) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(statement.getConnectionCallbackInterface()); statement.completeSqlca(sqlca); break; } case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.DTAMCHRM: parseDTAMCHRM(); break; case CodePoint.OBJNSPRM: parseOBJNSPRM(); break; case CodePoint.RDBNACRM: parseRDBNACRM(); break; case CodePoint.SQLERRRM: { NetSqlca sqlca = parseSqlErrorCondition(); statement.completeSqlca(sqlca); break; } default: parseCommonError(peekCP); } } void parseExecuteImmediateError(StatementCallbackInterface statement) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(statement.getConnectionCallbackInterface()); statement.completeSqlca(sqlca); break; } case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.DTAMCHRM: parseDTAMCHRM(); break; case CodePoint.OBJNSPRM: parseOBJNSPRM(); break; case CodePoint.RDBNACRM: parseRDBNACRM(); break; case CodePoint.SQLERRRM: { NetSqlca sqlca = parseSqlErrorCondition(); statement.completeSqlca(sqlca); break; } default: parseCommonError(peekCP); break; } } void parseDescribeError(StatementCallbackInterface statement) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(statement.getConnectionCallbackInterface()); statement.completeSqlca(sqlca); break; } case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.RDBNACRM: parseRDBNACRM(); break; case CodePoint.SQLERRRM: { NetSqlca sqlca = parseSqlErrorCondition(); statement.completeSqlca(sqlca); break; } default: parseCommonError(peekCP); } } void parseOpenQueryError(StatementCallbackInterface statementI) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(statementI.getConnectionCallbackInterface()); statementI.completeSqlca(sqlca); break; } case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.DTAMCHRM: parseDTAMCHRM(); break; case CodePoint.OBJNSPRM: parseOBJNSPRM(); break; case CodePoint.QRYPOPRM: parseQRYPOPRM(); break; case CodePoint.RDBNACRM: parseRDBNACRM(); break; default: parseCommonError(peekCP); } } void parseExecuteError(StatementCallbackInterface statementI) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(statementI.getConnectionCallbackInterface()); statementI.completeSqlca(sqlca);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -