RHS -> Allan->WSPJ ->Exercises -> Blog 04

Blog exercise 04

In the previous 3 Blog exercises we have created an ArrayList holding the onformation and then traversed the listed to put the information in a HTML table. This is off course not an useful way!!

In this exercise you should change the Servlet you created in Blog 03 exercise and make it use a database.
Open a connection to your database (must be created an populated with data first), then read all information and use it to create Story objects that you put into an ArrayList object. The use the strategy from Blog 03 to forward control to the JSP document.

Basically you can use the structure from Blog 03 (a Servlet takes care of the necessary computing and a JSP document takes care of viewing the result), but you are free to make any other classes (normal java-classes or Servlets) if you want - maybe you'd like a database-facade?

You can use any DBMS you like. If you want to use Java DB you can find instructions here: Installing Java DB and her: Create a database in Java DB


Maintained by: Allan Helboe
Updated: 28 November, 2007 15:57