Guestbook 3 -- Guestbook implementation JDBC
Study the following Guestbook Form and its associated CGI program to
handle the transactions:
View the Source code of the form. Fill out and submit the form.
Note that each time you fill out and submit the form, it writes your
information into a database table guestbook3.
The response from the
submission of the form is a formatted table containing all guestbook
entries on file, including the one you just submitted as the last entry.
Assignment: Guestbook 3
Using the command mysql -p, we login to the mysql monitor
using
a password (you will be prompted for the password). In the use statement,
you should substitute your MySQL database name (same as your triton
userid).
% mysql -p
Enter password: *******
mysql> use schmitt
mysql> create table guestbook3 (
name char(50),
aff1 char(50),
aff2 char(50),
email char(50))\g
mysql> exit
%
Your assignment is to copy the guestbook form to your presentation area.
Also copy the GuestJDBC.java program and associated the shell script to
your triton WWW/cgi-bin directory.
Split the functions of the textfile.java program into two separate CGI
programs:
- a program which will handle the guestbook form submitted by the user.
The user-supplied data should be appended to the database table
guestbook3. Compute an HTML response thanking the user for submitting
the form and echo back as an HTML table, all the information that that
form only.
- a program for viewing the guestbook. The contents of the entire
database table guestbook3 is formatted into an HTML table and displayed.
Modify the guestbook form to contain a submit button for viewing the
guestbook as well as the existing form with a submit button for storing an
new entry.
You should create a link with the text Guestbook 3 which points to your copy of
the new guestbook form. In that form be sure that it specifies two submit
buttons that will call upon your two CGI programs to be executed on
triton.