Using UDR Manager to create UDRs in the database server involves:
For details about coding UDRs, see the IBM Informix: J/Foundation Developer's Guide.
For information about creating an sbspace, see the Administrator's Guide for your database server and the IBM Informix: J/Foundation Developer's Guide.
Creating a UDR for a C-language opaque type is not supported; the opaque type must be in Java.
To specify a UDR for the driver to register, use this method in UDRMetaData:
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.
Once you have specified the UDRs to be registered, you can set the JAR file SQL name using UDRMetaData.setJarFileSQLName() and then use the UDRManager.createUDRs() method to install the UDRs in the database server, as follows:
public void createUDRs(UDRMetaData mdata, String jarfile, String classname, int deploy) throws SQLException
The jarfile parameter is the absolute or relative pathname of the client-side JAR file that contains the Java method definitions. If you use the absolute pathname, the JAR filename 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 page 1.
For the deploy parameter, see Specifying Deployment Descriptor Actions.
The createUDRs() method causes the driver to perform all of the following steps for your application:
After createUDRs() executes, your application can use the UDRs in SQL statements.