Three-tier Example (MCS-270, Spring 2003)

Introduction

This page describes a Three-tier example that Max set up using Java's RMI technology. To see the JavaSoft's more detailed explanation, go to the Getting Started link at the their webpage JavaTM Remote Method Invocation (RMI)

Necessary files

Following are the files you need:

Following is a file describing the database:

Deployment process

Following is the process I go through to get the applet running (assuming that you have the three java files in some source-file directory, and the html file in some accessible place in your www-docs):

  1. Same as the first step in Two-tier Example (courtesy JavaSoft(TM)) , so not necessary if you have already done it.

  2. Same as the second step in Two-tier Example (courtesy JavaSoft(TM)) , so not necessary if you have already done it.

  3. Save the six java files above in some source-file directory. Go to that directory and issue the following command to compile the java files to the appropriate directory:
             javac -d ~/public_html/codebase *.java
    

  4. Set your classpath:
             setenv KARL ~karl
             setenv CLASSPATH $HOME/public_html/codebase:$KARL/public/mcs270/psql-movies/postgresql.jar:.
    

  5. Run rmic to create skeletons/stubs:
             rmic -d ~/public_html/codebase edu.gac.karl.gened.ServerImpl
    

  6. Start the server (you must issue this command from the serving computer, which must also have its CLASSPATH set as above):
             java -Djava.rmi.server.codebase=http://kilpinen.mcs.gac.edu/~karl/codebase/ \
                  -Djava.security.policy=$HOME/public_html/policy \
                  edu.gac.karl.gened.ServerImpl
    

  7. Click on the link above for the running version of the applet

Notice

The data provided by this program may only be used for the instructional purposes within the context of the course MCS-270. Other uses, including distribution of the data, in part or in its entirety, is strictly forbidden. In particular, please note that this refers to old course data, and is not relevant for the upcoming semester at Gustavus.