} else if (ba.length <= 32767) {
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
lidAndLengths[i][1] = 32767;
} else {
// Promote to a BLOB. Only reach this path in the absence of describe information.
Blob b = new Blob(ba, netAgent_, 0);
// inputRow[i] = b;
// Place the new Lob in the promototedParameter_ collection for
// NetStatementRequest use
promototedParameters_.put(new Integer(i), b);
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
}
break;
case java.sql.Types.LONGVARBINARY:
ba = (byte[]) inputRow[i];
if (ba == null) {
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
lidAndLengths[i][1] = 32767;
} else if (ba.length <= 32767) {
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
lidAndLengths[i][1] = 32767;
} else {
// Promote to a BLOB. Only reach this path in the absensce of describe information.
Blob b = new Blob(ba, netAgent_, 0);
// inputRow[i] = b;
// Place the new Lob in the promototedParameter_ collection for
// NetStatementRequest use
promototedParameters_.put(new Integer(i), b);
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
}
break;
case java.sql.Types.BLOB:
java.sql.Blob b = (java.sql.Blob) inputRow[i];
if (b == null) {
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
lidAndLengths[i][1] =
buildPlaceholderLength(parameterMetaData.sqlLength_[i]);
} else if (b instanceof Blob && ((Blob)b).isLocator()){
//we are sending locators.
//Here the LID local identifier in the FDODSC
//FD:OCA descriptor should be initialized as
//to contain a BLOB locator.
lidAndLengths[i][0] =
DRDAConstants.DRDA_TYPE_NLOBLOC;
lidAndLengths[i][1] = 4;
} else {
lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
try {
if( b instanceof Blob &&
( (Blob) b).willBeLayerBStreamed() ){
//Correspond to totalLength 0 as default length for unknown
lidAndLengths[i][1] = 0x8002;
}else {
lidAndLengths[i][1] = buildPlaceholderLength(b.length());
}
} catch (java.sql.SQLException e) {
throw new SqlException(netAgent_.logWriter_,
new ClientMessageId(SQLState.NET_ERROR_GETTING_BLOB_LENGTH), e);