Java applets – IBM GC09-2830-00 User Manual

Page 142

Advertising
background image

java prog_name

where prog_name is the name of the program.

The DB2 JDBC driver handles the JDBC API calls from your application and
uses the DB2 CAE to communicate the requests to the server and receive the
results.

An SQLJ application must be bound to the database before it is run.

Java Applets

Because Java applets are delivered over the web, a web server must be
installed on your DB2 machine (server or client).

To run your applet, make sure your .html file is properly configured. Start the
JDBC applet server on the TCP/IP port specified in the .html file. For
example, if you specified:

param name=port value='6789'

then you would enter:

db2jstrt 6789

You must ensure that your working directory is accessible to your web
browser. If it is not, copy your applet’s .class and .html files into a directory
that is accessible. For SQLJ applets, you must also copy the profile .class and
.ser files as well.

Copy the sqllib/java/db2java.zip file into the same directory as these other
files. For SQLJ applets, also copy the sqllib/java/runtime.zip file into this
directory. Then on your client machine start your web browser (which
supports JDK 1.1) and load the .html file.

When your applet calls the JDBC API to connect to DB2, the JDBC driver
establishes separate communications with the DB2 database through the JDBC
applet server residing on the DB2 server.

An SQLJ applet must be bound to the database before it is run.

130

Quick Beginnings

Advertising