Java applet considerations

Data servers can be accessed by using Java™ applets.

Keep the following points in mind when using them:
  • For a larger JDBC or SQLJ applet that consists of several Java classes, you might choose to package all its classes in a single JAR file. For an SQLJ applet, you would also have to package its serialized profiles along with its classes. If you choose to do this, add your JAR file into the archive parameter in the "applet" tag. For details, see the documentation for your software development kit for Java.
    For SQLJ applets, some browsers do not yet have support for loading a serialized object from a resource file associated with the applet. For example, you will get the following error message when trying to load the supplied sample applet Applt in those browsers:
     java.lang.ClassNotFoundException: Applt_SJProfile0                       
    As a workaround, there is a utility which converts a serialized profile into a profile stored in Java class format. The utility is a Java class called sqlj.runtime.profile.util.SerProfileToClass. It takes a serialized profile resource file as input and produces a Java class containing the profile as output. Your profile can be converted using one of the following commands:
       profconv Applt_SJProfile0.ser
    or
       java sqlj.runtime.profile.util.SerProfileToClass Applt_SJProfile0.ser
    The class Applt_SJProfile0.class is created as a result. Replace all profiles in .ser format used by the applet with profiles in .class format, and the problem should go away.
  • You can place the file db2jcc4.jar into a directory that is shared by several applets that might be loaded from your Web site. db2jcc4.jar is for applets using the IBM® Data Server Driver for JDBC and SQLJ or for any SQLJ applet. This file is in the sqllib\java directory on Windows operating systems, and in the sqllib/java directory on UNIX. You might need to add a codebase parameter into the "applet" tag in the HTML file to identify the directory. For details, see the documentation for your software development kit for Java.
  • The JDBC applet server (listener), db2jd, contains signal handling to make it more robust. As a result, you cannot use the CTRL-C key sequence to terminate db2jd. Therefore, the only way to terminate the listener is to kill the process by using kill -9 (for UNIX) or the Task Manager (for Windows).