/** For a single result set, just echo the consistency token that the client sent us. * For subsequent resultSets, just subtract the resultset number from * the consistency token and that will differentiate the result sets. * This seems to be what DB2 does * @param rsNum - result set # starting with 0 * * @return Consistency token for result set */ protected ConsistencyToken calculateResultSetPkgcnstkn(int rsNum) { ConsistencyToken consistToken = pkgcnstkn; if (rsNum == 0 || pkgcnstkn == null) return consistToken; else { BigInteger consistTokenBi = new BigInteger(consistToken.getBytes()); BigInteger rsNumBi = BigInteger.valueOf(rsNum); consistTokenBi = consistTokenBi.subtract(rsNumBi); consistToken = new ConsistencyToken(consistTokenBi.toByteArray()); } return consistToken; }
/** * Write RSLSETRM * Instance variables * SVRCOD - Severity code - Information only - required * PKGSNLST - list of PKGNAMCSN -required * SRVDGN - Server Diagnostic Information -optional * * @throws DRDAProtocolException * @throws SQLException */ private void writeRSLSETRM(DRDAStatement stmt) throws DRDAProtocolException,SQLException { int numResults = stmt.getNumResultSets(); writer.createDssReply(); writer.startDdm(CodePoint.RSLSETRM); writer.writeScalar2Bytes(CodePoint.SVRCOD, 0); writer.startDdm(CodePoint.PKGSNLST); for (int i = 0; i < numResults; i++) writePKGNAMCSN(stmt.getResultSetPkgcnstkn(i).getBytes()); writer.endDdm(); writer.endDdmAndDss(); }
new Pkgnamcsn(rdbnam.toString(), rdbcolid.toString(), pkgid.toString(), pkgsn, new ConsistencyToken(token));
/** * Write RSLSETRM * Instance variables * SVRCOD - Severity code - Information only - required * PKGSNLST - list of PKGNAMCSN -required * SRVDGN - Server Diagnostic Information -optional * * @throws DRDAProtocolException * @throws SQLException */ private void writeRSLSETRM(DRDAStatement stmt) throws DRDAProtocolException,SQLException { int numResults = stmt.getNumResultSets(); writer.createDssReply(); writer.startDdm(CodePoint.RSLSETRM); writer.writeScalar2Bytes(CodePoint.SVRCOD, 0); writer.startDdm(CodePoint.PKGSNLST); for (int i = 0; i < numResults; i++) writePKGNAMCSN(stmt.getResultSetPkgcnstkn(i).getBytes()); writer.endDdm(); writer.endDdmAndDss(); }
new Pkgnamcsn(rdbnam.toString(), rdbcolid.toString(), pkgid.toString(), pkgsn, new ConsistencyToken(token));
/** For a single result set, just echo the consistency token that the client sent us. * For subsequent resultSets, just subtract the resultset number from * the consistency token and that will differentiate the result sets. * This seems to be what DB2 does * @param rsNum - result set # starting with 0 * * @return Consistency token for result set */ protected ConsistencyToken calculateResultSetPkgcnstkn(int rsNum) { ConsistencyToken consistToken = pkgcnstkn; if (rsNum == 0 || pkgcnstkn == null) return consistToken; else { BigInteger consistTokenBi = new BigInteger(consistToken.getBytes()); BigInteger rsNumBi = BigInteger.valueOf(rsNum); consistTokenBi = consistTokenBi.subtract(rsNumBi); consistToken = new ConsistencyToken(consistTokenBi.toByteArray()); } return consistToken; }
/** * Write RSLSETRM * Instance variables * SVRCOD - Severity code - Information only - required * PKGSNLST - list of PKGNAMCSN -required * SRVDGN - Server Diagnostic Information -optional * * @throws DRDAProtocolException * @throws SQLException */ private void writeRSLSETRM(DRDAStatement stmt) throws DRDAProtocolException,SQLException { int numResults = stmt.getNumResultSets(); writer.createDssReply(); writer.startDdm(CodePoint.RSLSETRM); writer.writeScalar2Bytes(CodePoint.SVRCOD, 0); writer.startDdm(CodePoint.PKGSNLST); for (int i = 0; i < numResults; i++) writePKGNAMCSN(stmt.getResultSetPkgcnstkn(i).getBytes()); writer.endDdm(); writer.endDdmAndDss(); }
new Pkgnamcsn(rdbnam.toString(), rdbcolid.toString(), pkgid.toString(), pkgsn, new ConsistencyToken(token));
/** For a single result set, just echo the consistency token that the client sent us. * For subsequent resultSets, just subtract the resultset number from * the consistency token and that will differentiate the result sets. * This seems to be what DB2 does * @param rsNum - result set # starting with 0 * * @return Consistency token for result set */ protected ConsistencyToken calculateResultSetPkgcnstkn(int rsNum) { ConsistencyToken consistToken = pkgcnstkn; if (rsNum == 0 || pkgcnstkn == null) return consistToken; else { BigInteger consistTokenBi = new BigInteger(consistToken.getBytes()); BigInteger rsNumBi = BigInteger.valueOf(rsNum); consistTokenBi = consistTokenBi.subtract(rsNumBi); consistToken = new ConsistencyToken(consistTokenBi.toByteArray()); } return consistToken; }