![]() |
Servers, Servlets, and Applets
|
|
Working with a Database AppletNOTE: You can do this example if you purchased and installed Cloudconnector. OverviewThe JBMSTours application includes an applet. An applet is a "client-side" Java application that runs embedded in a Web browser. The applet uses the Cloudconnector client driver to connect to Cloudscape running in the Cloudconnector framework. Cloudconnector provides both the HTTP and database services; it is both a Web server and a database server. NOTE: The applet runs only in Web browsers supporting at least JDK1.1.4. No instructions are provided for using appletviewer. About the AppletThe JBMSTours application includes the class JBMSTours.applet.ClientApplet. This applet starts the Cloudconnector client driver, opens a connections to the toursDB database, and provides a SQL query window for the connection with the first suggested query already filled in. If you wish, examine the source code for the applet, JBMSTours.applets.ClientApplet.java, in /demo/programs/tours/JBMSTours/applets. The directory /demo/programs/tours/JBMSTours also contains a supporting HTML page, ClientApplet.html. Configure and Start CloudconnectorNOTE: These instructions assume that you are familiar with how to start Cloudconnector on the command line. You will need to restart Cloudconnector in this example. For a good introduction to how to start Cloudconnector, see the instructions for running Cloudscape's simple demo. You will need to restart Cloudconnector in this example.
Access the Applet from a BrowserThe applet used in this demo is a JDK1.1 applet. It requires support and fixes made in JDK1.1.4 to operate in a Web browser. You can use either of the following browsers:
The browsers do not need any classes in their class path for this demo. The applet will download all needed classes from the Web server. NOTE: If you are using Netscape Navigator, your system CLASSPATH mustnot contain any of the classes the applet will download from the server. It is safest to clean out the system class path before starting the browser.
NOTE: The applet only supports one statement per execution; do not send batches. Security restrictions require that the applet access a database server on the same machine as the Web server that served it up. In this example, Cloudconnector is both the Web server and the database server, so access is not a problem. If you want to test the applet from behind a firewall, you will need to set up Cloudconnector for HTTP tunneling. |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |