Subject | Re: ArrayIndexOutOfBoundsException trying to read blob |
---|---|
Author | tesanovic |
Post date | 2007-10-13T08:02:41Z |
Hi!
I'm not sure but maybe the blob is smaller than 16 bytes or it is null.
I'm using the code above and I don't have any problems:
(assuming that your picture data is on position)
byte[] imageBytes = null;
Blob blob = rs.getBlob(4);
if (!rs.wasNull())
{
imageBytes = rs.getBytes(1, (int)blob.length());
}
I'm not sure but maybe the blob is smaller than 16 bytes or it is null.
I'm using the code above and I don't have any problems:
(assuming that your picture data is on position)
byte[] imageBytes = null;
Blob blob = rs.getBlob(4);
if (!rs.wasNull())
{
imageBytes = rs.getBytes(1, (int)blob.length());
}