Subject Re: [Firebird-Java] Re: getObject and blob
Author Marczisovszky Daniel
>> I think you are right, getObject() should return byte[]. I will
>> correct this after I check the specs once more.

r> Ok, I checked the JDBC 3.0 specs, and on the page B-179 you can find
r> the mapping for ResultSet.getObject() and CallableStatement.getObject
r> (). byte[] should be returned for any BINARY type, and for BLOB you
r> should get the Blob instance.

r> Since the FBBlobField corresponds to the BLOB type (Firebird has no
r> BINARY type, only BLOB), I will not change the type of the object
r> returned in this particular class.

Well, this is an interesting question, although I don't know what is
the difference between BINARY and BLOB...

The interesting thing is the following: if you look at the page 181
and 182, you will see that BLOB should not be accessed by neither
getString nor getBytes, moreover you should not pass a String or a
byte[] to a Blob. So the current behaviour of the FBBlobField is
much more similar to a BINARY field rather than a BLOB field with the
only exception that it returns a Blob instead of byte[] ;) Actually I
can say in the current implementation the FBBlobField *does* implement
the BINARY (VARBINARY, etc...) type, not the BLOB type, and in my
opinion the driver should be consistent in this question.

Best wishes,