IBM GC09-2830-00 manual Java Applets

Models: GC09-2830-00

1 196
Download 196 pages 29.94 Kb
Page 142
Image 142
Java Applets

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 ®le is properly con®gured. Start the JDBC applet server on the TCP/IP port speci®ed in the .html ®le. For

example, if you speci®ed:

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 ®les into a directory that is accessible. For SQLJ applets, you must also copy the pro®le .class and

.ser ®les as well.

Copy the sqllib/java/db2java.zip ®le into the same directory as these other ®les. For SQLJ applets, also copy the sqllib/java/runtime.zip ®le into this

directory. Then on your client machine start your web browser (which supports JDK 1.1) and load the .html ®le.

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.

130Quick Beginnings

Page 142
Image 142
IBM GC09-2830-00 manual Java Applets