IBM Books

What's New


Changes to Chapter 8. Building Java Applications and Applets

The following replaces the entire chapter.

You can develop Java programs to access DB2 databases with the appropriate Java Development Kit (JDK) on Windows NT, Windows 98, Windows 95, and OS/2. The JDK includes Java Database Connectivity (JDBC), a dynamic SQL API for Java.

DB2 JDBC support is provided by the DB2 Client Application Enabler (DB2 CAE). With this support you can build and run JDBC applications and applets. These contain dynamic SQL only, and use a Java call interface to pass SQL statements to DB2.

The DB2 Software Developer's Kit (DB2 SDK) provides support for Java embedded SQL (SQLJ). With DB2 SQLJ support and DB2 JDBC support you can build and run SQLJ applications and applets. These contain static SQL and use embedded SQL statements that are bound to a DB2 database.

The SQLJ support provided by the DB2 SDK includes:

Building and running different types of Java programs requires support from different components of DB2:

For more information on DB2 programming in Java, see "Programming in JDBC". This covers creating and running JDBC applications, applets, stored procedures and UDFs. For information on SQLJ applications, applets, stored procedures and UDFs, see "Embedded SQL for Java (SQLJ) Programming".

For the latest, updated DB2 Java information, visit the Web Page at http://www.software.ibm.com/data/db2/java.

Setting the Environment

Windows NT, Windows 98 and Windows 95

To build Java applications on a supported Windows platform with DB2 JDBC support, you need to install and configure the following on your development machine:

  1. The Java Development Kit (JDK) Version 1.1 for Win32 from Sun Microsystems (refer to http://www.software.ibm.com/data/db2/java).

  2. The DB2 Client Application Enabler for Windows NT and Windows 95 from the DB2 Client Pack. It must be Version 2.1.2 or later.

To run DB2 Java stored procedures or UDFs, you also need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH c:\jdk11

where c:\jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.

To run Java programs on a supported Windows platform with DB2 JDBC support, the following environment variables are automatically updated when DB2 is installed, to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   %DB2PATH%\java\sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   %DB2PATH%\java\runtime.zip

OS/2

To build Java applications on OS/2 with DB2 JDBC support, you need to install and configure the following on your development machine:

  1. The Java Development Kit (JDK) Version 1.1 for OS/2 from IBM (refer to http://www.software.ibm.com/data/db2/java).

  2. The DB2 Client Application Enabler for OS/2 from the DB2 Client Pack. It must be Version 2.1.2 or later.

The JDK must be installed in an HPFS drive to allow long filenames with extensions greater than three characters, such as .java. Your Java working directory must also be on an HPFS drive. If you will be running Java stored procedures or UDFs on an OS/2 server, DB2 must be installed on an HPFS drive on the server in order to allow the stored procedure or UDF .class files to be placed in the %DB2PATH%\function directory.

To run DB2 Java stored procedures or UDFs, you need to update the DB2 database manager configuration on the server to include the path where the JDK is installed on that machine. You can do this by entering the following on the server command line:

   db2 update dbm cfg using JDK11_PATH c:\jdk11

where c:\jdk11 is the path where the JDK is installed.

You can check the DB2 database manager configuration to verify the correct value for the JDK11_PATH field by entering the following command on the server:

   db2 get dbm cfg

You may want to pipe the output to a file for easier viewing. The JDK11_PATH field appears near the beginning of the output. For more information on these commands, see the Command Reference.

To run Java programs on OS/2 with DB2 JDBC support, the following environment variables are automatically updated when DB2 is installed, to ensure that:

To build SQLJ programs, CLASSPATH is also updated to include the file:

   %DB2PATH%\java\sqlj.zip

To run SQLJ programs, CLASSPATH is also updated to include the file:

   %DB2PATH%\java\runtime.zip

Java Sample Programs

DB2 provides sample programs, used in the following sections, to demonstrate building and running JDBC programs that exclusively use dynamic SQL, and SQLJ programs that use static SQL. The Java samples are located in the %DB2PATH%\samples\java directory. The directory also contains a README and a makefile. Please see the section "The Java Makefile".

Before modifying or building the sample programs, it is recommended that you copy them from the %DB2PATH%\samples\java directory to a separate working directory.

On OS/2, your working directory must be on an HPFS drive. Since DB2 sample programs are provided on OS/2 to be compatible with FAT drives, filenames have at most a three character extension. To comply with this restriction, Java sample files have been truncated. After copying the Java files to your working directory, you can rename the truncated files by the following commands:

                                                                     
   move *.jav *.java                                              
   move *.htm *.html                                              
   move *.sql *.sqlj

To run these sample programs, you must first create and populate the sample database by entering:

   db2sampl

General Points for Building and Running DB2 Java Programs

  1. You must build and run DB2 Java applications and applets from a window where your environment variables are set. You can do this by running db2profile. Refer to Chapter 2, "Setup", on page 19 if you need more information.

  2. To build DB2 SQLJ programs, or to run any DB2 Java programs, the database manager on the server must be started. Start the database manager, if it is not already running, by entering the following command on the server:
       db2start
    

The Java Makefile

The makefile provided for the Java sample programs is presented below. The makefile will only work if a compatible make executable program is resident on your system in a directory included in your PATH variable. A suitable make utility may be provided by another language compiler. Please read the comment at the beginning of the text of the makefile for more information.

The make commands used to build specific Java sample programs are cited in the sections that follow. There is one change from makefiles normally used for other languages. The make clean command removes all files produced by the java compiler: .java files and core dumps; the make cleanall command removes these files as well as any files produced by the SQLJ translator.

The makefiles for the supported Windows platforms and for OS/2 are identical except for the header information,

for Windows platforms:

# IBM DB2 Universal Database Version 5
# for Windows NT, Windows 98 and Windows 95
# Makefile for DB2 Java samples

and for OS/2:

# IBM DB2 Universal Database Version 5 for OS/2
# Makefile for DB2 java samples

The rest of the makefile is as follows:

# The makefile will only work if a compatible make executable program is          
# resident on your system in a directory included in your PATH variable. 
# Such a make utility may be provided by another language compiler. If you 
# do not have a compatible make utility you cannot use this makefile, but 
# you can still compile and run these programs by entering the commands
# at the command line, as explained in the README.        
 
# To build your applications using this makefile, you can use one of 
# the following commands:
 
#   make all         - builds all the programs in this directory
#   make <prog_name> - builds a program designated by <prog_name>
#   make clean       - removes all files produced by the java compiler
#                      from your working directory (such as .class files)
#   make cleanall    - removes all files from your working directory produced
#                           by both the sqlj translator and java compiler.	
 
# This file assumes the DB2 instance path is defined by the variable HOME.
# It also assumes that DB2 is installed under the DB2 instance.
# If these conditions are not true, redefine DB2INSTANCEPATH
DB2INSTANCEPATH = $(HOME)
 
# Use the java compiler
CC= javac
 
# To connect to another database update the DATASOURCE variable.
# User ID and password are optional. If you want to use them,
# update TESTUID with your user ID, and TESTPWD with your password.
 
DATASOURCE=sample
TESTUID=
TESTPWD=
 
COPY = copy
ERASE = del
 
# Note: 'all' contains RunCatUdf, which executes the 'java CatUdf' command,
# as this must be run before the 'make Udf' command. 
all : DB2Appl DB2Applt DB2Stp DB2Udf App Applt Stp CatUdf RunCatUdf Udf DropUdf
 
RunCatUdf : 
	java CatUdf
 
clean :
	$(ERASE) *.class
	$(ERASE) core
 
cleanall : clean
	$(ERASE) App.java
	$(ERASE) Applt.java
	$(ERASE) Stp.java
	$(ERASE) CatUdf.java
	$(ERASE) Udf.java
	$(ERASE) DropUdf.java
	$(ERASE) *.ser
 
# Build and run the following JDBC application with these commands:
#
#	make DB2Appl
#	java DB2Appl
#
DB2Appl.class : DB2Appl.java
DB2Appl : DB2Appl.class
	$(CC) DB2Appl.java
 
# After following the setup instructions in the README, you can
# build and run the following JDBC applet with these commands:
#
#	make DB2Applt
#	appletviewer DB2Applt.html
#
DB2Applt.class : DB2Applt.java
DB2Applt : DB2Applt.class
	$(CC) DB2Applt.java
 
# Build and run the following JDBC stored procedure with these commands:
#
#	make DB2Stp
#	java DB2Stp
#
DB2Stp.class : DB2Stp.java
DB2Stp : DB2Stp.class
	$(CC) DB2Stp.java
	$(COPY) DB2StpSample.class $(DB2PATH)\function
 
# Build and run the following JDBC UDF with these commands:
#
#	make DB2Udf
#	java DB2Udf
#
DB2Udf.class : DB2Udf.java
DB2Udf : DB2Udf.class
	$(CC) DB2Udf.java
	$(COPY) DB2UdfSample.class $(DB2PATH)\function
 
# Build and run the following SQLJ application with these commands:
#
#	make  App
#	java  App
#
App.java : App.sqlj
	sqlj App.sqlj 
App.class : App.java App_SJProfile0.ser
App : App.class
	$(CC) App.java
	db2profc -url=jdbc:db2:sample -prepoptions="package using App" App_SJProfile0
 
 
# After following the setup instructions in the README, you can
# build and run the following SQLJ applet with these commands:
#
#	make Applt
#	appletviewer Applt.html
#	
Applt.java : Applt.sqlj
	sqlj Applt.sqlj
Applt.class : Applt.java Applt_SJProfile0.ser
Applt : Applt.class
	$(CC) Applt.java
	db2profc -url=jdbc:db2:sample -prepoptions="package using Applt" Applt_SJProfile0
 
 
# Build and run the following SQLJ stored procedure with these commands:
#
# 	make  Stp
#	java  Stp
# 
Stp.java : Stp.sqlj
	sqlj Stp.sqlj
Stp.class : Stp.java Stp_SJProfile0.ser
Stp : Stp.class
	$(CC) Stp.java
	db2profc -url=jdbc:db2:sample -prepoptions="package using Stp" Stp_SJProfile0
	$(COPY) Stpsrv.class $(DB2PATH)\function
	$(COPY) Stp_Cursor1.class $(DB2PATH)\function
	$(COPY) Stp_Cursor2.class $(DB2PATH)\function
	$(COPY) Stp_SJProfileKeys.class $(DB2PATH)\function
	$(COPY) Stp_SJProfile0.ser $(DB2PATH)\function
 
# The following SQLJ User-Defined Function application requires three programs.
# Build and run the UDF programs with these commands:
#
#	nmake CatUdf
#	java CatUdf
#	nmake Udf
#	java Udf
#	nmake DropUdf
#	java DropUdf
#
# Note: 'java CatUdf' must be executed before 'nmake Udf'. The 'make all'
# command calls RunCatUdf, which executes 'java CatUdf', before calling Udf.
#
CatUdf.java : CatUdf.sqlj
	sqlj CatUdf.sqlj
CatUdf.class : CatUdf.java CatUdf_SJProfile0.ser
CatUdf : CatUdf.class
	$(CC) CatUdf.java
	db2profc -url=jdbc:db2:sample -prepoptions="package using CatUdf" CatUdf_SJProfile0
 
 
Udf.java : Udf.sqlj
	sqlj Udf.sqlj
Udf.class : Udf.java Udf_SJProfile0.ser
Udf : Udf.class
	$(CC) Udf.java
	db2profc -url=jdbc:db2:sample -prepoptions="package using Udf" Udf_SJProfile0
	$(COPY) Udfsrv.class $(DB2PATH)\function
 
DropUdf.java : DropUdf.sqlj
	sqlj DropUdf.sqlj
DropUdf.class : DropUdf.java DropUdf_SJProfile0.ser
DropUdf : DropUdf.class
	$(CC) DropUdf.java
	db2profc -url=jdbc:db2:sample -prepoptions="package using DropUdf" DropUdf_SJProfile0

JDBC Programs

Applications

DB2Appl demonstrates a dynamic SQL Java application using the JDBC Application driver to access a DB2 database.

Command Line. To build and run this application by commands entered at the command line:

  1. Compile DB2Appl.java with this command:

    javac DB2Appl.java

    to produce the file: DB2Appl.class.

  2. Run the java interpreter on the application with this command:
    java DB2Appl
    

makefile. To build this application with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build the application with this command:
    make DB2Appl
    

  3. Run the java interpreter on the application with this command:
    java DB2Appl
    

Applets

DB2Applt demonstrates a dynamic SQL Java applet using the JDBC applet driver to access a DB2 database.

Command Line. To build and run this applet by commands entered at the command line:

  1. Ensure that a web server is installed on your DB2 machine (server or client).

  2. Modify the DB2Applt.html file according to the instructions there.

  3. Start the JDBC applet server on the TCP/IP port specified in DB2Applt.html; for example, if in DB2Applt.html, you specified:

    param name=port value='6789'

    then you would enter:

    db2jstrt 6789
    

  4. Compile DB2Applt.java with this command:

    javac DB2Applt.java

    to produce the file DB2Applt.class.

  5. Ensure that your working directory is accessible by your web browser. If it is not, copy DB2Applt.class and DB2Applt.html into a directory that is accessible.

  6. Copy the file %DB2PATH%\java\db2java.zip into the same directory as DB2Applt.class and DB2Applt.html.

  7. On your client machine, start your web browser (which supports JDK 1.1) and load DB2Applt.html.

As an alternative to steps (1), (5) and (7), you can use the applet viewer that comes with the Java Development Kit by entering the following command in the working directory of your client machine:

appletviewer DB2Applt.html

makefile. To build this applet with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Ensure that a web server is installed on your DB2 machine (server or client).

  3. Modify the DB2Applt.html file according to the instructions there.

  4. Start the JDBC applet server on the TCP/IP port specified in DB2Applt.html; for example, if in DB2Applt.html, you specified:

    param name=port value='6789'

    then you would enter:

    db2jstrt 6789
    

  5. Build the applet with this command:
    make DB2Applt
    

  6. Ensure that your working directory is accessible by your web browser. If it is not, copy DB2Applt.class and DB2Applt.html into a directory that is accessible.

  7. Copy the file %DB2PATH%\java\db2java.zip into the same directory as DB2Applt.class and DB2Applt.html.

  8. On your client machine, start your web browser (which supports JDK 1.1) and load DB2Applt.html.

As an alternative to steps (2), (6) and (8), you can use the applet viewer that comes with the Java Development Kit by entering the following command in the working directory of your client machine:

appletviewer DB2Applt.html

Stored Procedures

DB2Stp demonstrates how to write a dynamic SQL Java stored procedure using the JDBC Application driver to access a DB2 database.

Command Line. To build and run this stored procedure by commands entered at the command line:

  1. Compile DB2Stp.java with this command:

    javac DB2Stp.java

    This will produce the files DB2Stp.class and DB2StpSample.class.

  2. Copy DB2StpSample.class to the %DB2PATH%\function directory.

  3. Run the java interpreter on the stored procedure with this command:
    java DB2Stp
    

makefile. To build this stored procedure with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build the stored procedure with this command:
    make DB2Stp
    

  3. Run the java interpreter on the stored procedure with this command:
    java DB2Stp
    

User-Defined Functions

DB2Udf demonstrates implementing dynamic SQL user-defined functions using the JDBC Application driver to access a DB2 database.

Command Line. To build and run this UDF program by commands entered at the command line:

  1. Compile DB2Udf.java with this command:

    javac DB2Udf.java

    This will produce the files DB2Udf.class and DB2UdfSample.class.

  2. Copy DB2UdfSample.class to the %DB2PATH%\function directory.

  3. Run the java interpreter on the UDF program with this command:
    java DB2Udf
    

makefile. To build this UDF program with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build the UDF program with this command:
    make DB2Udf
    

  3. Run the java interpreter on the UDF program with this command:
    java DB2Udf
    

SQLJ Programs

Applications

App demonstrates an SQLJ application that accesses a DB2 database.

Command Line. To build and run this application by commands entered at the command line:

  1. Translate App.sqlj with this command:

    sqlj App.sqlj

    This will produce the files App.java and App_SJProfile0.ser.

  2. Compile App.java with this command:
    javac App.java
    

    This will produce the files: App.class, App_Cursor1.class, App_Cursor2.class and App_SJProfileKeys.class.

  3. Customize the generated profile and create the package App in the sample database with this command:
    db2profc -url=jdbc:db2:sample prepoptions="package using App" App_SJProfile0
    

  4. Run the application with this command:
    java App
    

makefile. To build this application with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build the application with this command:
    make App
    

  3. Run the application with this command:
    java App
    

Applets

Applt demonstrates an SQLJ applet that accesses a DB2 database.

Command Line. To build and run this applet by commands entered at the command line:

  1. Ensure that a web server is installed on your DB2 machine (server or client).

  2. Modify the Applt.html file according to the instructions there.

  3. Start the JDBC applet server on the TCP/IP port specified in Applt.html; for example, if in Applt.html, you specified:

    param name=port value='6789'

    then you would enter:

    db2jstrt 6789
    

  4. Translate Applt.sqlj with this command:

    sqlj Applt.sqlj

    This will produce the files: Applt.java and Applt_SJProfile0.ser.

  5. Compile Applt.java with this command:
    javac Applt.java
    

    This will produce the files: Applt.class, Applt_Cursor1.class, Applt_Cursor2.class and Applt_SJProfileKeys.class.

  6. Customize the generated profile and create the package Applt in the sample database with this command:
    db2profc -url=jdbc:db2:sample -prepoptions="package using Applt" Applt_SJProfile0
    

  7. Ensure that your working directory is accessible by your web browser. If it is not, copy the following files into a directory that is accessible:
    Applt.html                              Applt.class,
    Applt_Cursor1.class,                    Applt_Cursor2.class,
    Applt_SJProfileKeys.class,              Applt_SJProfile0.ser
    

  8. Copy the files %DB2PATH%\java\db2java.zip and %DB2PATH%\java\runtime.zip into the same directory as your other Applt files.

  9. On your client machine, start your web browser (which must support JDK 1.1) and load Applt.html.

As an Alternative to steps (1), (7) and (9), you can use the applet viewer that comes with the Java Development Kit by entering the following command in the working directory of your client machine:

appletviewer Applt.html

makefile. To build this applet with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Ensure that a web server is installed on your DB2 machine (server or client).

  3. Modify the Applt.html file according to the instructions there.

  4. Start the JDBC applet server on the TCP/IP port specified in Applt.html. For example, if in Applt.html, you specified:

    param name=port value='6789'

    then you would enter:

    db2jstrt 6789
    

  5. Build the applet with this command:
    make Applt
    

  6. Ensure that your working directory is accessible by your web browser. If it is not, copy the following files into a directory that is accessible:
    Applt.html,                             Applt.class,
    Applt_Cursor1.class,                    Applt_Cursor2.class,
    Applt_SJProfileKeys.class,              Applt_SJProfile0.ser
    

  7. Copy the files %DB2PATH%\java\db2java.zip and %DB2PATH%\java\runtime.zip into the same directory as your other Applt files.

  8. On your client machine, start your web browser (which must support JDK 1.1) and load Applt.html.

As an Alternative to steps (2), (6) and (8), you can use the applet viewer that comes with the Java Development Kit by entering the following command in the working directory of your client machine:

appletviewer Applt.html

Stored Procedures

Stp demonstrates an SQLJ stored procedure that accesses a DB2 database.

Command Line. To build and run this stored procedure by commands entered at the command line:

  1. Translate Stp.sqlj with this command:

    sqlj Stp.sqlj

    This will produce the files Stp.java and Stp_SJProfile0.ser.

  2. Compile Stp.java with this command:

    javac Stp.java

    This will produce the files: Stp.class, Stpsrv.class, Stp_Cursor1.class, Stp_Cursor2.class and Stp_SJProfileKeys.class.

  3. Customize the generated profile and create the package Stp in the sample database with this command:
    db2profc -url=jdbc:db2:sample -prepoptions="package using Stp" Stp_SJProfile0
    

  4. Copy these files to the %DB2PATH%\function directory: Stpsrv.class, Stp_Cursor1.class, Stp_Cursor2.class, Stp_SJProfileKeys.class and Stp_SJProfile0.ser.

  5. Run the stored procedure with this command:
    java Stp
    

makefile. To build this stored procedure with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build the stored procedure with this command:
    make Stp
    

  3. Run the stored procedure with this command:
    java Stp
    

User-Defined Functions

The %DB2PATH%\samples\java directory includes a UDF application consisting of three SQLJ programs:

CatUdf.

Command Line. To build and run this SQLJ program by commands entered at the command line:

  1. Translate CatUdf.sqlj with this command:

    sqlj CatUdf.sqlj

    This will produce the files CatUdf.java and CatUdf_SJProfile0.ser.

  2. Compile CatUdf.java with this command:

    javac CatUdf.java

    This will produce the files CatUdf.class and CatUdf_SJProfileKeys.class.

  3. Customize the generated profile and create the package CatUdf in the sample database with this command:
    db2profc -url=jdbc:db2:sample -prepoptions="package using CatUdf" CatUdf_SJProfile0
    

  4. Run CatUdf with this command:
    java CatUdf
    

  5. Next, run the Udf program.

makefile. To build and run this SQLJ program with the makefile:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build and run CatUdf with this command:
    make CatUdf
    

  3. Next, run the Udf program.

Udf.

Command Line. To build and run this SQLJ program by commands entered at the command line:

  1. Translate Udf.sqlj with this command:

    sqlj Udf.sqlj

    This will produce the files Udf.java and Udf_SJProfile0.ser.

  2. Compile Udf.java with this command:

    javac Udf.java

    This will produce the files: Udf.class, Udf_Cursor1.class, Udf_Cursor2.class, Udf_Cursor4.class, Udf_Cursor5.class, Udf_SJProfileKeys.class and Udfsrv.class.
    Note:There is no file Udf_Cursor3.class.

  3. Customize the generated profile and create the package Udf in the sample database with this command:
    db2profc -url=jdbc:db2:sample -prepoptions="package using Udf" Udf_SJProfile0
    

  4. Copy the Udfsrv.class file into %DB2PATH%\function.

  5. Run Udf with this command:
    java Udf
    

  6. Next, run the DropUdf program.

makefile. To build this SQLJ program with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build Udf with this command:
    make Udf
    

  3. Run Udf with this command:
    java Udf
    

  4. Next, run the DropUdf program.

DropUdf.

Command Line. To build and run this SQLJ program by commands entered at the command line:

  1. Translate DropUdf.sqlj with this command:

    sqlj DropUdf.sqlj

    This will produce the files DropUdf.java and DropUdf_SJProfile0.ser.

  2. Compile DropUdf.java with this command:

    javac DropUdf.java

    This will produce the files: DropUdf.class and DropUdf_SJProfileKeys.class.

  3. Customize the generated profile and create the package DropUdf in the sample database with this command:
    db2profc -url=jdbc:db2:sample -prepoptions="package using DropUdf" 
                   DropUdf_SJProfile0
    

  4. Run DropUdf with this command:
    java DropUdf
    

makefile. To build this SQLJ program with the makefile, and then run it:

  1. Ensure your environment includes a compatible make utility as specified in the section "The Java Makefile".

  2. Build DropUdf with this command:
    make DropUdf
    

  3. Run DropUdf with this command:
    java DropUdf
    

General Points for DB2 Java Applets

  1. For a larger JDBC or SQLJ applet that consists of several Java classes, you may 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 JDK Version 1.1 documentation.

  2. You may wish to place the file %DB2PATH%\java\db2java.zip (and for SQLJ applets, also the file %DB2PATH%\java\runtime.zip) into a directory that is shared by several applets that may be loaded from your Web site. In this case, you may need to add a codebase parameter into the "applet" tag in the HTML file to identify that directory. For details, see the JDK Version 1.1 documentation.

  3. For information on running DB2 Java applets on a webserver, specifically the Domino Go Webserver, see:
       http://www.software.ibm.com/data/db2/db2lotus/gojava.htm
    


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]