Subject | Re: [Firebird-Java] Re: reading binary data (CHARACTER SET OCTETS) |
---|---|
Author | Roman Rokytskyy |
Post date | 2006-08-29T20:03:55Z |
> Kettle developers think that binary data should be returned as byte[].Quite logical... I can understand them. Since they use standard mapping
> They don't want to make any workarounds into their application to
> enable Firebird to read binary data correctly when other databases
> doesn't have this problem.
defined in the specifications. If you use BLOB data type, you'll get
byte[] when calling ResultSet.getObject(int) method. But BLOBs are more
expensive in terms of network access (additional roundtrips to the
server).
> If you cannot change default behaviour of JDBC driver, can you changeI will think about it. Please add a feature request.
> it when some extra configuration option is set? Something like
> 'returnOctetsAsBytes' or whatever. When this option is set to true
> then JDBC driver could return CHAR/VARCHAR OCTETS as array of bytes. I
> hope it make sense.
Meanwhile, I'd say that you simply subclass the FBDriver class, override
the methods of the AbstractConnection class that create instances of
AbstractStatement, AbstractPreparedStatement and AbstractCallableStatement
classes, and the methods of FBResultSet class.
It may sound complicated, but that is few hours of work. But you will get
your custom version of driver that you can adapt to your needs.
> Or at least, when I set parameter encoding=OCTETS, all CHAR/VARCHARI see no reason for not allowing OCTETS in the connection string. I will
> should be returned as byte[]. As I tested, OCTETS is not allowed to be
> set for parameter encoding now. Is there any reason for this?
check it after my vacations. Please add this as bug report.
Roman