Subject Patch to fix blob handling
Author lhoriman
I'm using blobs with hibernate (actually ejb3 in jboss). My code is
entirely DB agnostic except for one small problem... the JayBird
driver won't accept any implementation of java.sql.Blob except it's
own. You can't use java.sql.Blob without relying on firebird-specific

This patch changes AbstractPreparedStatement.setBlob() so that instead
of throwing an exception, it converts the foreign Blob into a FBBlob.

Jeff Schnitzer

Index: src/main/org/firebirdsql/jdbc/
RCS file:
retrieving revision
diff -u -r1.18.2.1
--- src/main/org/firebirdsql/jdbc/ 24
Oct 2004 16:07:47 -0000
+++ src/main/org/firebirdsql/jdbc/ 19
May 2005 08:15:55 -0000
@@ -725,9 +725,9 @@
public void setBlob (int parameterIndex, Blob blob) throws
SQLException {
if (!(blob instanceof FBBlob)) {
- throw new FBSQLException(
- "You must use FBBlobs with Firebird.",
+ FBBlob fbb = (FBBlob)c.createBlob();
+ fbb.copyStream(blob.getBinaryStream(), (int)blob.length());
+ blob = fbb;
getField(parameterIndex).setBlob((FBBlob) blob);
isParamSet[parameterIndex - 1] = true;