Mapping for field types
The following table shows the mapping supported between the types defined for the ifxtype parameter in the UDTMetaData.setFieldType() method and the Java™ data types as they appear in the Java class file. Data types not shown in this table are not supported within the opaque type.
ifxtype parameter type from com.informix.lang.IfxTypes | Java data type |
---|---|
IFX_TYPE_BIGINT | long |
IFX_TYPE_BIGSERIAL | long |
IFX_TYPE_CHAR | java.lang.String |
IFX_TYPE_SMALLINT | short |
IFX_TYPE_INT | int |
IFX_TYPE_FLOAT | double |
IFX_TYPE_SMFLOAT | float1 |
IFX_TYPE_DECIMAL | java.lang.BigDecimal |
IFX_TYPE_SERIAL | int |
IFX_TYPE_DATE | Date |
IFX_TYPE_MONEY | java.lang.BigDecimal |
IFX_TYPE_DATETIME | java.lang.Timestamp if starting qualifier is Year, Month, or Day; otherwise, java.lang.Time (see Field lengths and date-time data). |
IFX_TYPE_INTERVAL | com.informix.lang.IfxIntervalYM if starting qualifier is Year or Month; otherwise, com.informix.lang.IfxIntervalDF (see Field lengths and date-time data). |
IFX_TYPE_NCHAR | java.lang.String |
IFX_TYPE_INT8 | long |
IFX_TYPE_SERIAL8 | long |
IFX_TYPE_BOOL | boolean |
IFX_TYPE_CLOB | java.sql.Clob |
IFX_TYPE_BLOB | java.sql.Blob |
1 This mapping is JDBC compliant. You can map IFX_TYPE_SMFLOAT data type (via the JDBC FLOAT data type) to the Java double data type for backward compatibility by setting the IFX_GET_SMFLOAT_AS_FLOAT environment variable to 1.