Create UDRs
- Coding the UDRs and packaging the code in a JAR file
For details about coding UDRs, see the HCL® J/Foundation Developer's Guide.
- Creating a default sbspace in the database server to hold the
JAR file that contains the code for the UDR
For information about creating an sbspace, see the HCL OneDB™ Administrator's Guide for your database server and the HCL J/Foundation Developer's Guide.
- Calling methods in the UDRMetaData class to specify the information necessary for HCL OneDB JDBC Driver to register the UDRs in the database server
- If desired, specifying a path name where the driver should place the JAR file in the database server file system
- Installing the UDRs in the server
Creating a UDR for a C-language opaque type is not supported; the opaque type must be in Java™.
public void setUDR(Method method, String sqlname) throws SQLException
The method parameter specifies an object from java.lang.Reflect.Method to be registered as a Java UDR in the database server. The sqlname parameter is the name of the method as used in SQL statements.
public void createUDRs(UDRMetaData mdata, String jarfile, String classname, int deploy) throws SQLException
The jarfile parameter is the absolute or relative path name of the client-side JAR file that contains the Java method definitions. If you use the absolute path name, the JAR file name must be included in your CLASSPATH setting.
The classname parameter is the name of a Java class that contains the methods you want to register as UDRs in the database server. Requirements for preparing the Java methods are described on 1.
For the deploy parameter, see Specify deployment descriptor actions.
- Obtain the JAR file designated by the first parameter.
- Transport the JAR file from the client local area to the server local area.
- Register the UDRs specified in the UDRMetaData object (set through one or more calls to UDRMetaData.setUDR()).
- Install the JAR file and create the UDRs in the server.