Homework 4
CS320, Fall 2008

Due: Wednesday, November 19

Please upload your files to CSNS. The files should include all the source code, documentation (if any), and an HTML file hw4.html, which contains a link to your JSP page on the CS3 server. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.



For this assignment, modify the BetNBA online betting game you developed in Homework 3 so that it stores all the information about games, users, and bets in a database. Again, all features described in previous assignments must work; otherwise there will be a credit penalty of up to 40pt.

1. (20pt) Design database tables to store information about games, users, and bets. Since this is not a database class, you do not have to worry about normal forms and such. However, you have to make sure that your database design is functional and correct. For example, a username attribute should have a UNIQUE constraint to ensure that two users cannot have the same name. For this part of the assignment, you need to turn in an SQL script file hw4.sql, which contains the statements to create all the tables in the database, and the statements to populate the tables so that each table has at least two records.

2. (50pt) Once the database is set up, modify the servlet/JSP code so that the application uses the database to store all the information.