JGUI Client Applet
The JGUI is a demonstration of the use of the Java
Client Library to build database clients.
It is a Java applet which can be run in any Java-enabled browser.
We recommend Netscape 3.0 or higher, or Internet Explorer 3.0 or higher.
Because Java Applets are subject to security constraints, the JC Applet can
only communicate directly with the host from which it was downloaded.
Since it must be able to communicate with the
PREDATOR server
(remember, this applet is going to be a database client), the JGUI must be
downloaded from the host on which the database server is running.
This is accomplished by starting a HTTP server (a.k.a. web server) on the
same machine. You can use _any_ HTTO server of your choice. A number of
free web servers are available. On Unix, we use httpd
and on WindowsNT, we use the excellent Sambar
server. Feel free to use your favorite one. It typically takes some
trial and error before you can get a web server to reliably serve your
applets (the typical issue is that it should be started in the correct
working directory so that the necessary Java classes and HTML files are
found in the appropriate subdirectories).
The port number you supply to the HTTP server must be different from the
database server's port number.
The next step is to create a HTML page which embeds the JGUI applet.
We have included a template along with the system (applettry.html).
Edit the template file and change the Applet parameter
PORT to reflect the port number of your
PREDATOR server
Finally, make sure your PREDATOR server is running.
Now you can start the JGUI by opening the web page in a Java-enabled
browser.
When the applet is loaded, it will connect to the
PREDATOR server.
After the connection is made, it provides a simple graphical client
interface. There is a "Break Connection" button to quit from the server.
When the result contains large ADTs like images or audio,
the actual large objects are not sent to the client as part
of the answer. Instead. a "handle" or identifier is sent.
In order to ask to see/play the actual object, you need to
click (left mouse button) on the particular cell of the
tabular display. The corresponding object is then retrieved
from the server and displayed appropriately.
Things to Keep in Mind
Be warned that in most browsers, applets are not reloaded when the
"Reload" button is hit. If you run into some initial
problem with the JC applet and need to reload it, either restart your
browser or use Shift-Reload (with Netscape).
Also please be warned that this applet uses a large number of Java classes
that can take a while to load.
Most Java VMs will fetch Java classes on an as-needed basis
(i.e. pretty much when they actually get invoked). This is
meant to minimize network traffic, I suppose.
However, this strategy is terrible in terms of latency.
The very first time you run the GUI, you will have to
twiddle your thumbs while all the classes are downloaded.
I tried this from home on a 28.8 line and as my advisor would
say, I had time to go down to Colombia, pick myself some
choice beans, roast them, and brew myself some really good
coffee. There are some improvements possible: one is to use
a JAR file. If your browser supports JAR files, try to take
advantage of this. Either way, things will be slow the first time,
but once the classes are cached, things are smooth.
TroubleShooting
Here are some possible causes of problems, and their symptoms:
- Browser unable to locate web server: has the web server
been started? Have you provided the correct port number for the web server?
- No such URL : did you start the web server in the right
directory so that it has access to SQL.html?
- Unable to load applet : does your browser support JDK1.02 or
higher?
- Applet hangs : have you started your server?
- Unable to restart applet: if your Restart or Reload button
does not work, try killing your browser and trying again.
- Still unable to connect: Open your Java Console (a choice
in the Options menu of Netscape), look at the error messages and send them
to PREDATOR user support.
- Callback of ADTs doesnt work: Did you run the
web server from the appropriate directory (P:\nt_proj on WindowsNT,
$XXXROOT/java on Solaris)?
Mail user support: predator-support@cs.cornell.edu
.... Back to PREDATOR Home Page