padScalarStreamForError(leftToRead, bytesToRead,
writeEXTDTAStatusByte, status);
// set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
netAgent_.accumulateReadException(new SqlException(
netAgent_.logWriter_,
new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ),
new Integer(parameterIndex),
e.getMessage(),
e));
return;
}
if (bytesRead == -1) {
status = DRDAConstants.STREAM_TOO_SHORT;
padScalarStreamForError(leftToRead, bytesToRead,
writeEXTDTAStatusByte, status);
// set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,
new ClientMessageId(SQLState.NET_PREMATURE_EOS),
new Integer(parameterIndex)));
return;
} else {
bytesToRead -= bytesRead;
offset_ += bytesRead;
leftToRead -= bytesRead;
}
} while (bytesToRead > 0);
bytesToRead = flushScalarStreamSegment(leftToRead, bytesToRead);
} while (leftToRead > 0);
// check to make sure that the specified length wasn't too small
try {
if (in.read() != -1) {
status = DRDAConstants.STREAM_TOO_LONG;
// set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,
new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL),
new Integer(parameterIndex)));
}
} catch (java.io.IOException e) {
status = DRDAConstants.STREAM_READ_ERROR;
netAgent_.accumulateReadException(new SqlException(
netAgent_.logWriter_,
new ClientMessageId(
SQLState.NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION),
new Integer(parameterIndex),
e.getMessage(),
e));
}