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.
User-defined data type | SQL statement |
---|---|
Distinct data type | CREATE DISTINCT TYPE |
Opaque data type | CREATE OPAQUE TYPE |
To create the mapping between a user-defined SQL data type and a Java object:
Procedure
Results
The online examples in $ONEDB_HOME/extend/krakatoa/examples.tar include a sample implementation of a UDT written in Java code, Circle.java.