Appendix C Creating Jaguar 1.1 Java Clients
This section shows you how to use Javasoft's JDK to compile and run your Java client. If you are using another Java development tool, see its documentation for information about how to compile and run your Java client.
Before you compile your applet or Java application, make sure that these paths are specified by the CLASSPATH environment variable:
To compile your Java client using the JDK, enter this command:
javac java_program.java
javac is the command to invoke the Java compiler.
java_program is the name of your Java application or applet.
For example, to compile the StockTest.java Java application, enter this command:
javac StockTest.java
To run the applet, place it in the appropriate directory on the server and create a test HTML page from which to run your applet. You must include the applet HTML tag on the test page.
<HTML>
<HEAD>
<TITLE>Applet Test Page
</TITLE>
</HEAD>
<BODY>
<P>This HTML page runs an applet.
</P>
<APPLET CODE="MyApplet.class" CODEBASE="/classes" WIDTH=500 HEIGHT=500>
</APPLET>
</BODY>
</HTML>
CODEBASE
specifies
the path to MyApplet.class. If the applet is
in the same directory as the HTML page, you do not have to specify CODEBASE
.
The path specified in CODEBASE
is
relative to the Jaguar server's document root (the default
is $JAGUAR/html). The forward
slash (/) must begin the CODEBASE
.
The applet cannot be compressed. CODEBASE
.CODE
would
be specified as:CODE="Animals/Cats/JagApp.class"
CODEBASE
:
Use the JDK Java interpreter to run the Java application.
Before you run your Java application, make sure that these paths are specified by the CLASSPATH environment variable:
In a UNIX shell or in a Windows console window, enter this command to run a Java application with the Java interpreter:
java java_application
where:
java is the command to invoke the Java interpreter.
java_application is the name of your Java application.
For example, to run the StockTest.class Java application, enter this command:
java StockTest
If you deploy a client applet on a different Web server than Jaguar, or if you deploy a client application to a different host (other than the host where Jaguar is installed), you must ensure that your client program has access to the required Java classes. Required Java packages are listed below.
In addition to the classes that implement your client program, you must ensure that the classes below are deployed with your applet or application.
Bcd
com/sybase/CORBA
com/sybase/CORBA/bcd
com/sybase/CORBA/hex
com/sybase/CORBA/http
com/sybase/CORBA/iiop
com/sybase/CORBA/jdbc102
com/sybase/CORBA/jdbc11
com/sybase/CORBA/utf
com/sybase/jaguar/beans
com/sybase/jaguar/stub
com/sybase/jaguar/util
Mjd
org/omg
SessionManager
TabularResults
Copyright © 2000 Sybase, Inc. All rights reserved. |