CPS 592B Assignment 3

Submit your assignment in a zip-file via e-mail.

  1. Read the section on sockets in the Java Tutorial and run the Knock-Knock programs. Add your own knock-knock jokes. You can find the source code in the file KnockKnock.zip.

  2. Modify the program DMoz.java from Chapter 7 of Java Network Programming to work with google.com and output its results in a JEditorPane as in Fig 21-2 from Java How to Program.

  3. Modify Fig. 18-29 to run over a network using Datagrams. That is, the client should send a String Object datagram to the server, and the server should return a ResultSet Object to the client. The client should not access the database itself.

  4. Write a servlet to capture requests in a database. For each request, add an entry in a requests table with a session ID number, the Date/Time of the request, the remote host and IP address. Add entries in a parameters table with the session ID number and the name and value fields. There could be multiple rows in the parameters table for each request.

  5. I'm told that the Tic-Tac-Toe example in Fig 21-7 and 21-8 does not work using separate machines. Verify the accuracy of this statement, and if it is true, change the example to make it work. Also do Exercise 21.23 (at least modification a).

  6. Read the Java Tutorial on servlets and implement the Duke's bookstore example. You can download the example code locally from tut-bookstore-21.zip.


Maintained by John Loomis, last updated 12 Feb 2001