These restrictions apply to Java™ user-defined functions (UDFs).
- A Java UDF
should not create additional threads. An additional thread may be created
in a job only if the job is multithread capable. Since it cannot be guaranteed
that a job that calls an SQL stored procedure is multithread capable, a Java stored
procedure should not create additional threads.
- The complete name of the Java stored procedure defined to the database
is limited to 279 characters. This limit is a consequence of the EXTERNAL_NAME
column, which has a maximum width of 279 characters.
- Adopted authority cannot be used to access Java class files.
- A Java UDF
always uses the latest version of the JDK that is installed on the system.
- Since Blob and Clob classes reside in both the java.sql and com.ibm.db2.app
packages, the programmer must use the entire name of these classes if both
classes are used in the same program. The program must ensure that the Blob
and Clob classes from the com.ibm.db2.app are used as the parameters passed
to the stored procedure.
- Like sourced functions, when a Java UDF is created, a service program in
the library is used to store the function definition. The name of the service
program is generated by the system and can be found in the job log of the
job that created the function. If this object is saved and then restored to
another system, then the function definition is restored. If a Java UDF
is to be moved from one system to another, you are responsible for moving
the service program that contains the function definition as well as the integrated
file system file that contains the Java class.
- A Java UDF
cannot set the properties (for example, system naming) of the JDBC connection
that is used to connect to the database. The default JDBC connection properties
are always used, except when prefetching is disabled.