Data type mapping between C opaque types and Java™
To create an opaque type using Java™, you can use the UDT and UDR Manager facility. For more information, see Work with opaque types.
All opaque data is stored in the database server table in a C struct, which is made up of various types, as defined in the opaque type. (For more information, see the HCL® Informix® DataBlade® API Programmer's Guide.)
The following table lists the mapping of types to their corresponding Java™ types.
| type | Java™ type |
|---|---|
| MI_LO_HANDLE | BLOB or CLOB |
| gl_wchar_t | String |
| mi_boolean | boolean |
| mi_char | String |
| mi_char1 | String |
| mi_date | Date |
| mi_datetime | TimeStamp |
| mi_decimal | BigDecimal |
| mi_double_precision | double |
| mi_int1 | byte |
| mi_int8 | long |
| mi_integer | int |
| mi_interval | Not supported |
| mi_money | BigDecimal |
| mi_numeric | BigDecimal |
| mi_real | float |
| mi_smallint | short |
| mi_string | String |
| mi_unsigned_char1 | String |
| mi_unsigned_int8 | long |
| mi_unsigned_integer | int |
| mi_unsigned_smallint | short |
| mi_wchar | String |
The C struct may contain padding bytes. HCL Informix® JDBC Driver automatically skips these padding bytes to make sure the next data member is properly aligned. Therefore, your Java™ objects do not have to take care of alignment themselves.