Subject Re: [Firebird-Java] Obscure error
Author William L. Thomson Jr.

On Thu, 2003-02-06 at 04:44, Simon Harper wrote:
> Hi there,
> I get an error from some data which is in an odd state. I'm afraid
> I'm not sure how best to describe it, but it's a blob that has no
> content, but is not defined as null.

This is your problem and I suggest correcting in on the DB end instead
of the driver. An empty blob should be set to null, there is no reason
to do other wise. Unless you have one.

> This is the error (through
> ColdFusion MX):
> java.sql.SQLException: You can't read a new blob
> at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(
> at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(
> at org.firebirdsql.jdbc.FBBlob.getBinaryStream(
> at org.firebirdsql.jdbc.FBLongVarCharField.getBytes(
> at org.firebirdsql.jdbc.FBLongVarCharField.getCachedObject(
> at org.firebirdsql.jdbc.FBCachedFetcher.<init>(
> at org.firebirdsql.jdbc.FBResultSet.<init>(
> at org.firebirdsql.jdbc.FBStatement.getCachedResultSet(
> at org.firebirdsql.jdbc.FBStatement.execute(
> The query which generates this error does work in Firebird (I'm using
> IB Manager to test this), and indeed if I go into the data and
> explicitly set the offending field to null, the query works again via
> JayBird.

I had the same problems, but resolved it by cleaning up the data in my

Otherwise if you really want to get around this error, go to the point
in the driver code that throws the error and change it. That's what I
did prior to cleaning up my database.

William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989