// We always get the BLOB, even when we are not reading the contents.
// Since the BLOB is just a pointer to the BLOB data rather than the
// data itself, this operation should not take much time (as opposed
// to getting all of the data in the blob).
Blob blob = rs.getBlob(index);
if (rs.wasNull())
return null;
// BLOB exists, so try to read the data from it
// based on the user's directions
if (_readBlobs)
{
// User said to read at least some of the data from the blob
byte[] blobData = null;
if (blob != null)
{
int len = (int)blob.length();
if (len > 0)
{
int charsToRead = len;
if (! _readCompleteBlobs)
{
charsToRead = _readBlobsSize;
}
if (charsToRead > len)
{
charsToRead = len;
}
blobData = blob.getBytes(1, charsToRead);
}
}
// determine whether we read all there was in the blob or not
boolean wholeBlobRead = false;