Login to osprey7 as before and go to your "webhome" directory. Go to the directory RMI. In it is a README file with generic directions and the directoryy DBC, which has all the files for this example. In this lab, we are going to give a slightly different version of the directions to make sure that everyone is running their example on different ports.
Look at the files
In order for everyone to run this example, we want you to pick a port number between 1024 and 9999. This is the port that you will run your name registry:
rmiregistry xxxx &where xxxx is your port number. If someone else is already using that number, you'll get a message and can pick a new one.
This port number also needs to be put into two files. In DBCImpl.java, change the port name in the registry:
Naming.rebind("//osprey7.npac.syr.edu:xxxx/DBCServer", obj);In the file index.html, change the url parameter:
>param name="url" value="//osprey7.npac.syr.edu:xxxx/DBCServer"<
Now you need to compile all the .java files:
javac *.java
Generate the stub and skeleton:
rmic -d /servers/cgi-http-class/htdoc/arlspring98-docs/v11/RMI DBC.DBCImpl
Start the DBC Implementation running (as the RMI server):
java -Djava.rmi.server.codebase=http://osprey7.npac.syr.edu:3768/arlspring98-docs/v11/RMI/ DBC.DBCImpl &
To run the user interface applet, in your desktop browser, give the URL
http://osprey7.npac.syr.edu:3768/arlspring98-docs/v11/RMI/DBC/index.html
The main activity for this lab is to write your own example. Using the database you created yesterday, change the DBC example files as necessary. For example, if you added a field to the person database, the simplest thing would be to keep the only search by name capability, but to return the additional field value.
Additional information about writing JDBC is found on-line at http://osprey7.npac.syr.edu:3768/reference-docs/cwou/database/3-Tier-JDBC/.