Creating a Java user-defined routine in the server

When you create Java™ user-defined routines (UDRs) in the server, you need to write and compile the source code and then install the finished code in the database server.

About this task

To create a Java routine:

Procedure

  1. Write the UDR, which can use the HCL OneDB™ JDBC Driver methods to interact with the database server.
  2. If the UDR uses any user-defined data types (UDTs), for each UDT write a Java class that translates between the database server and Java representation of the type.

    This class implements the java.sql.SQLData interface.

  3. Write the CREATE FUNCTION or CREATE PROCEDURE statement for registering the UDR.
  4. Write the deployment descriptor, which contains the SQL statements for registering the UDR.
  5. Prepare the manifest file.
  6. Compile the Java source files and collect the compiled code into a JAR file.
  7. Create a JAR file that contains the classes, deployment descriptor, and manifest file.
  8. Install the JAR file that contains the UDR in the current database.
  9. Execute the UDR.
  10. Use tracing and the debugging features to work out any problems in the UDR.
  11. Optimize performance of the UDR.

Results

See Java technology dependencies.