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

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>(FBBlob.java:338)
> at org.firebirdsql.jdbc.FBBlob$FBBlobInputStream.<init>(FBBlob.java:336)
> at org.firebirdsql.jdbc.FBBlob.getBinaryStream(FBBlob.java:158)
> at org.firebirdsql.jdbc.FBLongVarCharField.getBytes(FBLongVarCharField.java:77)
> at org.firebirdsql.jdbc.FBLongVarCharField.getCachedObject(FBLongVarCharField.java:119)
> at org.firebirdsql.jdbc.FBCachedFetcher.<init>(FBCachedFetcher.java:119)
> at org.firebirdsql.jdbc.FBResultSet.<init>(FBResultSet.java:122)
> at org.firebirdsql.jdbc.FBStatement.getCachedResultSet(FBStatement.java:565)
> at org.firebirdsql.jdbc.FBStatement.execute(FBStatement.java:473)
>
> 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
database.

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.

--
Sincerely,
William L. Thomson Jr.
Support Group
Obsidian-Studios Inc.
439 Amber Way
Petaluma, Ca. 94952
Phone 707.766.9509
Fax 707.766.8989
http://www.obsidian-studios.com