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
- Write the UDR, which can use the HCL OneDB™ JDBC
Driver methods
to interact with the database server.
- 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.
- Write the CREATE FUNCTION or CREATE PROCEDURE statement
for registering the UDR.
- Write the deployment descriptor, which contains the SQL
statements for registering the UDR.
- Prepare the manifest file.
- Compile the Java source
files and collect the compiled code into a JAR file.
- Create a JAR file that contains the classes, deployment
descriptor, and manifest file.
- Install the JAR file that contains the UDR in the current
database.
- Execute the UDR.
- Use tracing and the debugging features to work out any
problems in the UDR.
- Optimize performance of the UDR.