![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]()
(chat, newsreader, calendar)
|
![]() |
|
Course Notes Table of Contents | Exercises JDBC Short Course Index | Online Training Index
|
Applet-Based Guestbook |
Working Applet | Help Solution
|
PrerequisitesSkeleton CodeDue to the volume of comments received from the students, you want to convert the Command-Line Guestbook to work as an applet. Depending upon the JDBC driver you are using, and the location of the database server, the safest thing to do is to create a third tier to provide seamless access. The purpose of this exercise is to create the third tier and glue everything together. CommentsApplet serves as the completed frontend, so you don't have to worry about creating the GUI (although you can improve upon it if you want). CommentsClient serves as the applet piece that talks to the backend you are creating, so you don't have to worry about the network communications. The CommentsServer skeleton already contains the code for a multithreaded server. It is your responsibility to come up with the code to deal with each connection, the run method. As with the previous example, there is both a query and update mode. To test out your server without the GUI/applet, use CommentsClient.
Perform the following tasks:
Each connection to the CommentsServer creates an instance of CommentsConnection. It is your job to fillin the run method for this Thread. First determine which command came across. Valid commands are query and insert.
If you do not want to create specialized servers, you can buy them or use a JDBC driver that permits direct access from your applet with security ramifications. Sybase's jdbcConnect is one such product and the Imaginary JDBC driver for mSQL is another. One of the first Java middleware's on the market, even before JDBC, was from WebLogic. The task numbers above are linked to the step-by-step help page. Also available is a complete solution, which meets these requirements, and Expected Behavior. |
Copyright © 1997 MageLang Institute. All Rights Reserved May-97 Copyright © 1996, 1997 Sun Microsystems Inc. All Rights Reserved |