For this homework assignment, you will modify the guestbook example to store messages in a database instead of in memory.
This is an optional homework. Your lowest homework score will be automatically dropped from your homework grade.
You must submit this homework to your SVN repository using Eclipse. Your homework, including the src directory and all required source code files must be at the following location:
https://www.cs.usfca.edu/svn/<username>/cs212/homework11/
where <username> is your CS username in all lowercase letters. Failure to properly submit your homework will result in a point deduction.
The explicit locations required for key files are:
https://www.cs.usfca.edu/svn/<username>/cs212/homework11/src/MessageServer.java
https://www.cs.usfca.edu/svn/<username>/cs212/homework11/src/MessageServlet.java
https://www.cs.usfca.edu/svn/<username>/cs212/homework11/src/DatabaseConnector.java
https://www.cs.usfca.edu/svn/<username>/cs212/homework11/database.properties
You must submit this programming homework by 11:59pm on Friday, May 3, 2012.
Modify the MessageServer demo in the Dynamic Webpages lecture page to store the guestbook messages in a database instead of in memory. Specifically:
Use the DatabaseConnector class from the Relational Databases lecture page to connect to the MySQL database on campus.
Include a database.properties file that allows us to modify the username, password, database, and hostname used to connect to the database.
Create a table guestbook to store the messages automatically if one is not found after connecting to the database. You may want to refer to the LoginServer demo in the Comprehensive Example lecture page.
SAFELY allow users via a POST form to insert guestbook messages into the database. Your code should not be vulnerable to XSS or SQL Injection attacks!
On a GET request, display all of the current guestbook messages stored in the database, showing the most recent message first.
There are no unit tests provided for this example.