1 21 22 package org.apache.derby.client.net; 23 24 import org.apache.derby.client.am.DisconnectException; 25 import org.apache.derby.client.am.ClientMessageId; 26 import org.apache.derby.shared.common.reference.SQLState; 27 28 public class NetPackageReply extends NetConnectionReply { 29 NetPackageReply(NetAgent netAgent, int bufferSize) { 30 super(netAgent, bufferSize); 31 } 32 33 34 NetSqlca parseSqlErrorCondition() throws DisconnectException { 35 parseSQLERRRM(); 36 parseTypdefsOrMgrlvlovrs(); 37 NetSqlca netSqlca = parseSQLCARD(null); 38 return netSqlca; 39 } 40 41 42 void parseDTAMCHRM() throws DisconnectException { 44 boolean svrcodReceived = false; 45 int svrcod = CodePoint.SVRCOD_INFO; 46 boolean rdbnamReceived = false; 47 String rdbnam = null; 48 49 parseLengthAndMatchCodePoint(CodePoint.DTAMCHRM); 50 pushLengthOnCollectionStack(); 51 int peekCP = peekCodePoint(); 52 53 while (peekCP != Reply.END_OF_COLLECTION) { 54 55 boolean foundInPass = false; 56 57 if (peekCP == CodePoint.SVRCOD) { 58 foundInPass = true; 59 svrcodReceived = checkAndGetReceivedFlag(svrcodReceived); 60 svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR, CodePoint.SVRCOD_ERROR); 61 peekCP = peekCodePoint(); 62 } 63 64 if (peekCP == CodePoint.RDBNAM) { 65 foundInPass = true; 66 rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived); 67 rdbnam = parseRDBNAM(true); 68 peekCP = peekCodePoint(); 69 } 70 71 if (!foundInPass) { 72 doPrmnsprmSemantics(peekCP); 73 } 74 75 } 76 popCollectionStack(); 77 checkRequiredObjects(svrcodReceived, rdbnamReceived); 78 79 netAgent_.setSvrcod(svrcod); 80 doDtamchrmSemantics(); 81 } 82 83 protected void parseRDBUPDRM() throws DisconnectException { 94 boolean svrcodReceived = false; 95 int svrcod = CodePoint.SVRCOD_INFO; 96 boolean rdbnamReceived = false; 97 String rdbnam = null; 98 99 parseLengthAndMatchCodePoint(CodePoint.RDBUPDRM); 100 pushLengthOnCollectionStack(); 101 102 netAgent_.netConnection_.setReadOnlyTransactionFlag(false); 108 109 int peekCP = peekCodePoint(); 110 111 while (peekCP != Reply.END_OF_COLLECTION) { 112 113 boolean foundInPass = false; 114 115 if (peekCP == CodePoint.SVRCOD) { 116 foundInPass = true; 117 svrcodReceived = checkAndGetReceivedFlag(svrcodReceived); 118 svrcod = parseSVRCOD(CodePoint.SVRCOD_INFO, CodePoint.SVRCOD_INFO); 119 peekCP = peekCodePoint(); 120 } 121 122 if (peekCP == CodePoint.RDBNAM) { 123 foundInPass = true; 124 rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived); 125 rdbnam = parseRDBNAM(true); 126 peekCP = peekCodePoint(); 127 } 128 129 if (!foundInPass) { 130 doPrmnsprmSemantics(peekCP); 131 } 132 133 } 134 popCollectionStack(); 135 checkRequiredObjects(svrcodReceived, rdbnamReceived); 136 137 netAgent_.setSvrcod(svrcod); 139 140 } 141 142 void parseSQLERRRM() throws DisconnectException { 157 boolean svrcodReceived = false; 158 int svrcod = CodePoint.SVRCOD_INFO; 159 boolean rdbnamReceived = false; 160 String rdbnam = null; 161 162 parseLengthAndMatchCodePoint(CodePoint.SQLERRRM); 163 pushLengthOnCollectionStack(); 164 int peekCP = peekCodePoint(); 165 166 while (peekCP != Reply.END_OF_COLLECTION) { 167 168 boolean foundInPass = false; 169 170 if (peekCP == CodePoint.SVRCOD) { 171 foundInPass = true; 172 svrcodReceived = checkAndGetReceivedFlag(svrcodReceived); 173 svrcod = parseSVRCOD(CodePoint.SVRCOD_ERROR, CodePoint.SVRCOD_ERROR); 174 peekCP = peekCodePoint(); 175 } 176 177 if (peekCP == CodePoint.RDBNAM) { 178 foundInPass = true; 179 rdbnamReceived = checkAndGetReceivedFlag(rdbnamReceived); 180 rdbnam = parseRDBNAM(true); 181 peekCP = peekCodePoint(); 182 } 183 184 if (!foundInPass) { 185 doPrmnsprmSemantics(peekCP); 186 } 187 188 } 189 popCollectionStack(); 190 checkRequiredObjects(svrcodReceived); 191 192 netAgent_.setSvrcod(svrcod); 194 } 195 196 198 200 protected Object parsePKGNAMCT(boolean skip) throws DisconnectException { 204 parseLengthAndMatchCodePoint(CodePoint.PKGNAMCT); 205 if (skip) { 206 skipBytes(); 207 return null; 208 } 209 agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_, 210 new ClientMessageId(SQLState.DRDA_COMMAND_NOT_IMPLEMENTED), 211 "parsePKGNAMCT")); 212 return null; } 214 } 215 | Popular Tags |