Subject | Poor Blob implementation.. snif.... |
---|---|
Author | gbouille2002 |
Post date | 2002-10-01T18:56:35Z |
I'm trying to use JBird with OJB (from apache jakarta).
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 !!... until 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).
Second, the length method of Blob class is not implemented !
That's too much for me. I decide to stop the use of Blob. Too bad.
So what is the road map for the complete implementation of the blob
support ?
When can I re-try to port OJB for Firebird ?
Thanx !
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 !!... until 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).
Second, the length method of Blob class is not implemented !
That's too much for me. I decide to stop the use of Blob. Too bad.
So what is the road map for the complete implementation of the blob
support ?
When can I re-try to port OJB for Firebird ?
Thanx !