After you have created the JAR file, use the UDTManager.createUDT() method to create the opaque type by sending the class definition to the database server:
public void createUDT(UDTMetaData mdata, String jarfile, String classname, int deploy) throws SQLException;
The jarfile parameter is the pathname of a JAR (.jar) file that contains the class definition for the opaque type. By default, the classes in the java.io package resolve relative pathnames against the current user directory as named by the system property user.dir; it is typically the directory in which the Java Virtual Machine was invoked. The filename must be included in your CLASSPATH setting if you use an absolute pathname.
The classname parameter is the name of the class that implements the opaque type.
The SQL name of the opaque type defaults to the class name if your application does not call setClassName(). You can specify an SQL name by calling the UDTMetaData.setSQLName() method.
In the UDTManager and UDRManager methods, the deploy parameter indicates whether install_actions should be executed if a deployment descriptor is present in the JAR file. The undeploy parameter indicates whether remove_actions should be executed.
A deployment descriptor allows you to include the SQL statements for creating and dropping UDRs in a JAR file. For more information about the deployment descriptor, see the IBM Informix: J/Foundation Developer's Guide and the SQLJ specification (Section 4.21 of the document SQLJ-Part 1: SQL Routines Using the Java Programming Language, available on the Web at http://www.sqlj.org).
When the driver ships the JAR file for an opaque type or UDR, it places the file by default in /tmp (on UNIX) or in c:\temp (on Windows). You can specify an alternative pathname by calling the setJarTmpPath() method in either the UDTManager or UDRManager class:
public void setJarTmpPath(String path) throws SQLException
You can call this method at any point before calling createUDT() or createUDR(), the UDTManager or UDRManager objects. The path parameter must be an absolute pathname, and you must ensure that the path exists on the server file system.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]