Subject | Re: Poor Blob implementation.. snif.... |
---|---|
Author | Roman Rokytskyy |
Post date | 2002-10-01T22:20:26Z |
Hi,
committed to CVS.
was able to read them back correctly. You will find this test case in
CVS in client-java/src/test/org/firebirdsql/jdbc/TestFBBlobAutocommit.java
According to the specification all getXXX methods that return subclass
of java.lang.Object must return null if the underlying column value is
null. If other drivers return you non-null value, this is not correct.
are still missing some methods, isc_blob_info() is among them.
so our driver should work for BINARY type (which is default for BLOB
SUB_TYPE 0 type in Firebird, java.sql.Blob is default only for blobs
with subtype < 0).
release version of this driver. We do not plan to implement new API
calls before release. This means that some features will not be in
release version. java.sql.Blob.length() among them.
Best regards,
Roman Rokytskyy
> I'm trying to use JBird with OJB (from apache jakarta).Thanks for pointing this out! I have implemented this method and
> Unfortunely, the method setEscapeProcessing(boolean) is not
> supported. As I don't know what it intend to do, I comment all the
> lines with this statement in OJB.... and it work fine !!...
committed to CVS.
> until II wrote a test case that stores empty blob (byte[0]) and null blob. I
> tryed to use a Bolb type field.
>
> here is the lines wich are problematic :
> static Object getObjectFromColumn(ResultSet rs, int jdbcType, int
> columnId) throws SQLException
> {
> Object result = null;
> switch (jdbcType)
> {
> case Types.BIT :
> {
> result = new Boolean(rs.getBoolean(columnId));
> break;
> }
> case Types.TINYINT :
> {
> byte val = rs.getByte(columnId);
> if (!rs.wasNull())
> result = new Byte(val);
> break;
> }
> ...
>
> ...
> case Types.BLOB :
> {
> java.sql.Blob aBlob = rs.getBlob(columnId);
> result = aBlob.getBytes(1L, (int) aBlob.length());
> break;
> }
> default :
> {
> throw new RuntimeException(
> "The type "
> + jdbcType
> + " for attribute "
> + columnId
> + " can not be handled by OJB. Please specify only types
> as defined by java.sql.Types.");
> }
> }
> return result;
> }
>
>
> At first, the getBlob method of ResultSet class return null if the
> blob field is empty. That's not seems to be the same in others JDBC
> connectors (there is no test here).
was able to read them back correctly. You will find this test case in
CVS in client-java/src/test/org/firebirdsql/jdbc/TestFBBlobAutocommit.java
According to the specification all getXXX methods that return subclass
of java.lang.Object must return null if the underlying column value is
null. If other drivers return you non-null value, this is not correct.
> Second, the length method of Blob class is not implemented !Unfortunatelly we do not have complete Firebird API implemented. We
are still missing some methods, isc_blob_info() is among them.
> That's too much for me. I decide to stop the use of Blob. Too bad.We correctly support getBytes(int) and getBinaryStream(int) methods,
so our driver should work for BINARY type (which is default for BLOB
SUB_TYPE 0 type in Firebird, java.sql.Blob is default only for blobs
with subtype < 0).
> So what is the road map for the complete implementation of the blobAs far as I know, no exact plans exist. Right now we are working on
> support ?
release version of this driver. We do not plan to implement new API
calls before release. This means that some features will not be in
release version. java.sql.Blob.length() among them.
Best regards,
Roman Rokytskyy