Subject Re: [Firebird-Java] Jaybird BLOB BUG???
Author Roman Rokytskyy

> I think I found a bug in Jaybird 2.1.0 . My problem is that I have
> store an image in DB as BLOB. If I want to get the image I got
> following error:
> java.lang.ClassCastException: org.firebirdsql.jdbc.FBCachedBlob
> at org.firebirdsql.jdbc.field.FBBlobField.getBytesInt
> ernal(
> at org.firebirdsql.jdbc.field.FBBlobField.getBytes(FB
> at org.firebirdsql.jdbc.field.FBField.getObject(FBFie
> at org.firebirdsql.jdbc.FBResultSet.getObject(FBResul
> Hope you can help me.

Yes, you have discovered a bug in Jaybird that was introduced in April this
year. I am really-really surprised that it was not discovered until now.

The only solution to it is to avoid using scrollable and/or holdable result
sets. Or you can fix it by using either ResultSet.getBlob() or
ResultSet.getBinaryStream() methods.

I hope to make a bugfix release this weekend, or beginning of next week at