You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Charles Anthony <ch...@hpdsoftware.com> on 2002/12/16 10:52:10 UTC

DB2/400 - platform changes

Hi all, 

We've just ported a prototype App of ours to DB2/400 - for those that don't
know, DB2/400 is the version of DB2 that runs on the
AS400/iSeries/zSeries/whatever-IBM-is-marketing-the machines-as-today.

All went very well; the only issue we had to resolve was BIT fields.
Essentially, the jdbc driver for the AS400 needs to map Booleans to a
SMALLINT.

We want, however, to keep the same repository.xml for all our platforms -
i.e. keep "BIT" in the field-descriptors in the repository.xml.

Essentially, we've modified the setObjectForStatmenet on PlatformDb2Impl to
:

if (sqlType == Types.TINYINT) {
  ps.setByte(index, ((Byte) value).byteValue());
} else if (sqlType == Types.BIT) {
/** Special hack **/
  ps.setObject(index, value, Types.SMALLINT);
} else {
  super.setObjectForStatement(ps, index, value, sqlType);
}

(and ditto for setNullForStatemnt)

We don't have access to a "normal" DB2 database at the moment, so I can't
verify that this would work for all DB2s.

Should I 
a) send in the modified DB2PlatformImpl and let someone else test it on a
normal DB2 installation or 
b) create a Db2400PlatformImpl.

If the latter, I guess that all I should have to do is change the
repository.dtd to allow Db2400 as database type. Is this correct ?

Cheers,

Charles.



This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.