The behaviors of installing and invoking UDRs written in Java code follow the SQLJ: SQL Routines specification. Every UDR written in Java code maps to an external Java static method whose class resides in a Java Archive (JAR) file that was installed in a database. The SQL-to-Java data type mapping is done according to the JDBC specification.
UDRs can be user-defined functions or user-defined procedures, which can return values or not, as follows:
For example, the following query returns the results of a UDR called area() as part of the query results:
SELECT diameter, area(diameter) FROM shapes WHERE diameter > 6
A procedure cannot be used in SQL expressions because it does not return a value. However, you can call it directly, as the following example shows:
EXECUTE PROCEDURE myproc(1, 5)
You can also call user-defined procedures within triggers.
For general information about UDRs, refer to the IBM Informix: User-Defined Routines and Data Types Developer's Guide.
UDRs written in Java code can perform the following tasks.
(UDRs that open JDBC connections cannot run in parallel.)
Iterator functions written in Java code are supported using some Informix extensions.
You cannot use UDRs written in Java code for any of the following features: