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

> 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(FBBlobField.java:125)
> at org.firebirdsql.jdbc.field.FBBlobField.getBytes(FB BlobField.java:113)
> at org.firebirdsql.jdbc.field.FBField.getObject(FBFie ld.java:563)
> at org.firebirdsql.jdbc.FBResultSet.getObject(FBResul tSet.java:515)
>
> 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
latest.

Thanks!
Roman