UDFsrv demonstrates Java user-defined functions. Since UDF programs do not contain SQL statements, a Java UDF program cannot contain SQLJ statements. Once the UDFsrv libary is created on the server, it may be accessed by a client application. DB2 provides both a JDBC client application, UDFcli , and an SQLJ client application, UDFclie . Either can be used to access the UDFsrv library.
To build and run the UDF program on the server by commands entered at the command line:
javac UDFsrv.java
UDFcli and UDFclie contain the CREATE FUNCTION SQL statement that you use to register the UDFs contained in UDFsrv with the database. UDFcli and UDFclie also contain SQL statements that make use of the UDFs, once they have been registered.