Creating UDT-to-Java mappings
The routine manager needs a mapping between SQL data values and Java™ objects to be able to pass parameters to and retrieve return results from a UDR. The SQL-to-Java data type mapping is performed according to the HCL OneDB™ JDBC Driver specification.
About this task
For built-in SQL data types, the routine manager can use mappings to existing OneDB JDBC Driver data types.
For any UDTs that your UDR uses, you must create mappings.
You can use the following UDTs in UDRs written in Java code.
User-defined data type | SQL statement |
---|---|
Distinct data type | CREATE DISTINCT TYPE |
Opaque data type | CREATE OPAQUE TYPE |
Restriction: You cannot use row or collection
data types in UDRs written in Java code.
To create the mapping between a user-defined SQL data type and a Java object:
Procedure
Results
The online examples in $INFORMIXDIR/extend/krakatoa/examples.tar include a sample implementation of a UDT written in Java code, Circle.java.