FINAL
CS320, Spring 2004


Make sure your JSPs work properly on the cs server. Print a hard copy of all your files and turn it in at the end of the exam. Do not forget to put your name and your server account name on the hard copy.


[Database Tables] Suppose you have three tables in your database. You may re-use the tables you created in the homework assignments, or you may create three new tables. Either way, your tables must satisfy the following requirements:
In the rest of the problem description, I will use the following tables as an example:
cpu: <ID:CHAR(6), Description:VARCHAR(128), Quantity:INT, Price:DECIMAL(8,2)>
hdd: <ID:CHAR(6), Description:VARCHAR(128), Capacity:INT, Quantity:INT, Price:DECIMAL(8,2)>
mb: <ID:CHAR(6), Description:VARCHAR(128), Quantity:INT, Price:DECIMAL(8,2)>

[Data Entry] Create a DataEntry.jsp which provides MS Access-style data entry interface to your database tables.

1. When DataEntry.jsp is requested without a table parameter, e.g. http://cs.calstatela.edu:8280/~csun/DataEntry.jsp, display the following:
Please choose one of the tables below:
When a user clicks on one of the links, DataEntry.jsp should be requested with a table parameter set to cpu, hdd, or mb accordingly.

2. When DataEntry.jsp is requested with a table parameter, e.g. http://cs.calstatela.edu:8280/~csun/DataEntry.jsp?table=cpu, display the following table:
ID Description
Quantity
Price
CPU001
Intel Pentium 4 3.2GHz
20
398.00




In particular,
3. When the Add button is clicked, insert the new record to the database table. Suppose a user adds a new record <"CPU002", "AthlonXP 2600+", 15, 79>, DataEntry.jsp should display the following after the Add button is clicked:
ID Description
Quantity
Price
CPU001
Intel Pentium 4 3.2GHz
20
398.00
CPU002
AhthlonXP 2600+
15
79.00





[Error Page] It is easy to make mistakes during data entry. Create a error page DataEntryError.jsp for DataEntry.jsp.

[Grading Criteria]

1. Database tables (10pt)

2. DataEntry.jsp
3. DataEntryError.jsp