The IfxToJavaType class
The IfxToJavaType class handles all the HCL Informix® to Java™ data type conversions. Separate methods are provided for converting each Informix data type.
The primitive data types of Java are boolean, char, byte, short, int, long, float, double. When ever possible, the conversion returns the primitive data type rather than the Object.
The
following table shows the data types that can be converted between
the Informix data
types to Java data types.
Informix data types | Java data types |
---|---|
BIGINT | long |
BYTE | int (as a large object ID, without an input stream) |
CHAR (n) / CHARACTER (n) | string |
DATE | java.sql.Date |
DATETIME | java.sql.Timestamp |
DATETIME | interval |
DATETIME | string |
DEC/DECIMAL (p,s) | java.lang.Bignum |
DOUBLE PRECISION (n) | double |
FLOAT | Same as DOUBLE PRECISION |
INT8 | long |
INT/INTEGER | int |
INTERVAL | interval |
MONEY (p,s) | Same as DECIMAL |
NUMERIC (p,s) | Same as DECIMAL |
REAL | real |
SERIAL (n) | int |
SMALLFLOAT | Same as REAL |
SMALLINT | short |
TEXT | int (as a large object ID, without an input stream) |
VARCHAR (m,r) | string |
In addition to the conversion methods, the follow methods
are also provided
- convertDateToDays()
- convertDaysToDate()
- rleapyear()
- widenByte()