Communicator e3000 MPE/iX Release 6.0 Express 1 (C.60.01) (30216-90286)
42 Chapter3
Technical Articles
HP Driver for JDBC
rounding, are denoted by a lowercase letter “x” in the conversion grid.
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
Table 3-2. Data Type Conversions
JDBC DATA TYPES
(vertical)
T
I
N
Y
I
N
T
S
M
A
L
L
I
N
T
I
N
T
E
G
E
R
B
I
G
I
N
T
R
E
A
L
F
L
O
A
T
D
O
U
B
L
E
D
E
C
I
M
A
L
N
U
M
E
R
I
C
B
I
T
C
H
A
R
V
A
R
C
H
A
R
L
O
N
G
V
A
R
C
H
A
R
B
I
N
A
R
Y
V
A
R
B
I
N
A
R
Y
L
O
N
G
V
A
R
B
I
N
A
R
Y
D
A
T
E
T
I
M
E
T
I
M
E
S
T
A
M
P
ALLBASE/SQL
DATA TYPES
(horizontal)
SMALLINT (16-bits) x X X XXXXXXxXXXxxx
INTEGER (32-bits) x x X X xxxXXxXXXxxx
REAL x x x x XXXXXXXXXxxx
FLOAT(1...24) x x x xxxXXXXXXXxxx
FLOAT(25...53) x x x xxxXXXXxxxxxx
DOUBLE
PRECISION
xxxxxxXXXxXXXxxx
DECIMAL x x x xxxxXXxXXXxxx
NUMERIC x x x xxxxXXxXXXxxx
CHAR x x x xxxxxxxXXXxxx
VARCHAR x x x xxxxxxxXXXxxx
DATE XXXx x x X x
TIME XXXxxx Xx
DATETIME X X X x x xxxX
INTERVAL X X X x x x