📄 netconnectionreply.java
字号:
break; default: parseCommonError(peekCP); break; } } void parseRollbackError() throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.RDBNACRM: parseRDBNACRM(); break; default: parseCommonError(peekCP); break; } } void parseExchangeServerAttributesError() throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.MGRLVLRM: parseMGRLVLRM(); break; default: parseCommonError(peekCP); } } void parseAccessSecurityError(NetConnection netConnection) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.RDBNFNRM: parseRDBNFNRM(netConnection); break; case CodePoint.RDBAFLRM: parseRdbAccessFailed(netConnection); break; default: parseCommonError(peekCP); } } void parseSecurityCheckError(NetConnection netConnection) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.OBJNSPRM: parseOBJNSPRM(); break; case CodePoint.RDBNFNRM: parseRDBNFNRM(netConnection); break; case CodePoint.RDBAFLRM: parseRdbAccessFailed(netConnection); break; default: parseCommonError(peekCP); } } void parseAccessRdbError(NetConnection netConnection) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.CMDCHKRM: parseCMDCHKRM(); break; case CodePoint.RDBACCRM: parseRDBACCRM(); break; case CodePoint.RDBAFLRM: parseRdbAccessFailed(netConnection); break; case CodePoint.RDBATHRM: parseRDBATHRM(netConnection); break; case CodePoint.RDBNFNRM: parseRDBNFNRM(netConnection); break; default: parseCommonError(peekCP); } } // Called by all the NET*Reply classes. void parseCommonError(int peekCP) throws DisconnectException { switch (peekCP) { case CodePoint.CMDNSPRM: parseCMDNSPRM(); break; case CodePoint.PRCCNVRM: parsePRCCNVRM(); break; case CodePoint.SYNTAXRM: parseSYNTAXRM(); break; case CodePoint.VALNSPRM: parseVALNSPRM(); break; default: doObjnsprmSemantics(peekCP); } } NetSqlca parseAbnormalEndUow(ConnectionCallbackInterface connection) throws DisconnectException { parseABNUOWRM(connection); if (peekCodePoint() != CodePoint.SQLCARD) { parseTypdefsOrMgrlvlovrs(); } NetSqlca netSqlca = parseSQLCARD(null); return netSqlca; } void parseRdbAccessFailed(NetConnection netConnection) throws DisconnectException { parseRDBAFLRM(); // an SQLCARD is returned if an RDBALFRM is returned. // this SQLCARD always follows the RDBALFRM. // TYPDEFNAM and TYPDEFOVR are MTLINC if (peekCodePoint() == CodePoint.TYPDEFNAM) { parseTYPDEFNAM(); parseTYPDEFOVR(); } else { parseTYPDEFOVR(); parseTYPDEFNAM(); } NetSqlca netSqlca = parseSQLCARD(null); //Check if the SQLCARD has null SQLException if(netSqlca.getSqlErrmc() == null) netConnection.setConnectionNull(true); else netConnection.completeSqlca(netSqlca); } // The Security Check (SECCHKRM) Reply Message indicates the acceptability // of the security information. // this method returns the security check code. it is up to the caller to check // the value of this return code and take the appropriate action. // // Returned from Server: // SVRCOD - required (0 - INFO, 8 - ERROR, 16 -SEVERE) // SECCHKCD - required // SECTKN - optional, ignorable // SVCERRNO - optional private void parseSECCHKRM(NetConnection netConnection) throws DisconnectException { boolean svrcodReceived = false; int svrcod = CodePoint.SVRCOD_INFO; boolean secchkcdReceived = false; int secchkcd = CodePoint.SECCHKCD_00; boolean sectknReceived = false; byte[] sectkn = null; parseLengthAndMatchCodePoint(CodePoint.SECCHKRM); pushLengthOnCollectionStack(); int peekCP = peekCodePoint(); while (peekCP != Reply.END_OF_COLLECTION) { boolean foundInPass = false; if (peekCP == CodePoint.SVRCOD) { // severity code. it's value is dictated by the SECCHKCD. // right now it will not be checked that it is the correct value // for the SECCHKCD. maybe this will be done in the future. foundInPass = true; svrcodReceived = checkAndGetReceivedFlag(svrcodReceived); svrcod = parseSVRCOD(CodePoint.SVRCOD_INFO, CodePoint.SVRCOD_SEVERE); peekCP = peekCodePoint(); } if (peekCP == CodePoint.SECCHKCD) { // security check code. this specifies the state of the security information. // there is a relationship between this value and the SVRCOD value. // right now this driver will not check these values against each other. foundInPass = true; secchkcdReceived = checkAndGetReceivedFlag(secchkcdReceived); secchkcd = parseSECCHKCD(); peekCP = peekCodePoint(); } if (peekCP == CodePoint.SECTKN) { // security token. // used when mutual authentication of the source and target servers // is requested. The architecture lists this as an instance variable // and also says that the SECTKN flows as reply data to the secchk cmd and // it must flow after the secchkrm message. Right now this driver doesn't // support ay mutual authentication so it will be ignored (it is listed // as an ignorable instance variable in the ddm manual). foundInPass = true; sectknReceived = checkAndGetReceivedFlag(sectknReceived); sectkn = parseSECTKN(true); peekCP = peekCodePoint(); } if (!foundInPass) { doPrmnsprmSemantics(peekCP); } } popCollectionStack(); // check for the required instance variables. checkRequiredObjects(svrcodReceived, secchkcdReceived); netConnection.securityCheckComplete(svrcod, secchkcd); } // Access to RDB Completed (ACRDBRM) Reply Message specifies that an // instance of the SQL application manager has been created and is bound // to the specified relation database (RDB). // // Returned from Server: // SVRCOD - required (0 - INFO, 4 - WARNING) // PRDID - required // TYPDEFNAM - required (MINLVL 4) (QTDSQLJVM) // TYPDEFOVR - required // RDBINTTKN - optional // CRRTKN - optional // USRID - optional // SRVLST - optional (MINLVL 5) private void parseACCRDBRM(NetConnection netConnection) throws DisconnectException { boolean svrcodReceived = false; int svrcod = CodePoint.SVRCOD_INFO; boolean prdidReceived = false; String prdid = null; boolean typdefnamReceived = false; boolean typdefovrReceived = false; boolean rdbinttknReceived = false; boolean crrtknReceived = false; byte[] crrtkn = null; boolean usridReceived = false; String usrid = null; parseLengthAndMatchCodePoint(CodePoint.ACCRDBRM); pushLengthOnCollectionStack(); int peekCP = peekCodePoint(); while (peekCP != Reply.END_OF_COLLECTION) { boolean foundInPass = false; if (peekCP == CodePoint.SVRCOD) { // severity code. If the target SQLAM cannot support the typdefovr // parameter values specified for the double-byte and mixed-byte CCSIDs // on the corresponding ACCRDB command, then the severity code WARNING // is specified on the ACCRDBRM. foundInPass = true; svrcodReceived = checkAndGetReceivedFlag(svrcodReceived); svrcod = parseSVRCOD(CodePoint.SVRCOD_INFO, CodePoint.SVRCOD_WARNING); peekCP = peekCodePoint(); } // this is the product release level of the target RDB server. if (peekCP == CodePoint.PRDID) { foundInPass = true; prdidReceived = checkAndGetReceivedFlag(prdidReceived); prdid = parsePRDID(false); // false means do not skip the bytes peekCP = peekCodePoint(); } if (peekCP == CodePoint.TYPDEFNAM) { // this is the name of the data type to the data representation mapping // definitions tha the target SQLAM uses when sending reply data objects. foundInPass = true; typdefnamReceived = checkAndGetReceivedFlag(typdefnamReceived); parseTYPDEFNAM(); peekCP = peekCodePoint(); } if (peekCP == CodePoint.TYPDEFOVR) { // this is the single-byte, double-byte, and mixed-byte CCSIDs of the // scalar data arrays (SDA) in the identified data type to data representation // mapping definitions. foundInPass = true; typdefovrReceived = checkAndGetReceivedFlag(typdefovrReceived); parseTYPDEFOVR(); peekCP = peekCodePoint(); } if (peekCP == CodePoint.USRID) { // specifies the target defined user ID. It is returned if the value of // TRGDFTRT is TRUE in ACCRDB. Right now this driver always sets this // value to false so this should never get returned here. // if it is returned, it could be considered an error but for now // this driver will just skip the bytes. foundInPass = true; usridReceived = checkAndGetReceivedFlag(usridReceived); usrid = parseUSRID(true); peekCP = peekCodePoint(); } if (peekCP == CodePoint.CRRTKN) { // carries information to correlate with the work being done on bahalf // of an application at the source and at the target server. // defualt value is ''. // this parameter is only retunred if an only if the CRRTKN parameter // is not received on ACCRDB. We will rely on server to send us this // in ACCRDBRM foundInPass = true; crrtknReceived = checkAndGetReceivedFlag(crrtknReceived); crrtkn = parseCRRTKN(false); peekCP = peekCodePoint(); } if (!foundInPass) { doPrmnsprmSemantics(peekCP); } } popCollectionStack(); // check for the required instance variables. checkRequiredObjects(svrcodReceived, prdidReceived, typdefnamReceived, typdefovrReceived); netConnection.rdbAccessed(svrcod, prdid, crrtknReceived, crrtkn); } // The End Unit of Work Condition (ENDUOWRM) Reply Mesage specifies // that the unit of work has ended as a result of the last command. //
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -