SE452: Homework [18/18] Previous pageContents

Goal: To write a JSP/Servlet/JavaBean web application that uses a database (and JDBC with JNDI) to store persistent data.

  1. Download and install the hsqldb database.
  2. Create a command line program called BuildDB that builds your database. Follow the examle supplied in class, it should take three arguments, the url, username, and password for the database. I'll use the program to create your database.
  3. Write a JSP/Servlet/JavaBean MVC application (similar to HW4) that uses a database on the back end. The current code should be very similar to what you already have, but you need to both store and retrieve data from the database in your application. The data submitted should be stored in a table (or multiple tables) and should be recallable by the application.
  4. Supply a web.xml file with a resource-ref entry for your database. This should match the context.xml file, and should be the JNDI name that you use in your code.
  5. Supply a context.xml file (just the one context node) for your application. It should have the Resource entry that corresponds to the web.xml setting you supply.

Supply the application as a deployable war file. Test deploying it before submitting it to make sure you have the format right. Place the source files for the servlet in a src directory in the war file. Please link the homework assignment to the index.html file in the document root. Please do not include the hsqldb.jar file in your lib directory, I already have a copy. (You should be placing it in your own tomcat_home/common/lib directory instead of in your webapp directory.)

Before submitting your code, practice building the entire environment from scratch to ensure that your database building code is correct and that your configurations are set correctly.

Do not write code that has any paths/drivers/urls hardcoded in it. Do not open any text files in your code for data (I know this isn't what we would do in the real world, but it is easier to test and grade). Everything should be configurable via the supplied xml files (config.xml and web.xml)

Grading Breakdown:

ItemPoints
configuration (web.xml and context.xml)10
Program to build database20
Servlet code that integrates to db30
JSP/JavaBean implementation20
Coding style and JavaDoc10
Proper Submission10
Total:100

Previous pageContents