HP Driver for JDBC User's Manual
46 Chapter5
ALLBASE/SQL Specifics
ALLBASE/SQL to JDBC Data Type Conversions
The conversion of any ALLBASE/SQL data type to the
java.sql.Types.BIT data type is such that only the value of zero, in
either numeric or character format, will be converted to the
java.sql.Types.BIT value of 0. All other values will be converted to
the java.sql.Types.BIT value of 1. Thus only the integer value 0, the
floating-point value 0.0, the decimal value 0 (not 0.0), and the character
string “0” will be converted to a bit value of 0. Everything else is
converted to a bit value of 1.
The conversion of an ALLBASE/SQL data type to a JDBC data type
that has a smaller degree of precision (such as conversion from
ALLBASE/SQL INTEGER to java.sql.Types.SMALLINT) will follow the
Java VM rules of casting one data type to another. This may result in
different values on different Java platforms. There is also no warning
generated when this occurs. It is up to the application developer to
choose the appropriate JDBC data type.
The conversion of an ALLBASE/SQL character data type to a JDBC
numeric data type uses the Java numeric conversion routines and any
necessary numeric casting. Thus this could result in a
java.lang.NumberFormatException being shown when the
conversion is performed. Again, the application developer should take
the necessary precautions.