Web Database project
This project has been developed during my postgraduate degree specialising in Bioinformatics (DESS Bioinformatique) at Lille University for Database and Web course. It was in collaboration with Emilie Pensec, another student.
The Project
The goal of this projet is to practise Java with database connection and servelts technology. We have developed a bean for connection to a database for the web. In the majority of applications using databases and Java, the problematic is always the same: displaying in a table information from a Resultset. If we look on it, there are in general two use categories: from a query, display the list of resulting rows or display a catalog card describing the first row. In traditionnal Java applications, an object of Object [ ][ ] type is fill in, which used in parameter to Swing JTable constructor. In the web applications, the query result is will be used to build a HTML table.
Project parts
The project is divided in five parts:
- Part 1. Due to this notes and to facilitate future application design, we wish to develop two classes. The first class OutilsBDD will contain mainly two methods, which return either an catalog card or a list from a ResultSet given in parameter. The second class OutilsWebBDD will contain two methods with the same call semantic, but, this time, by returning a character string coding for HTML. Eventually, this two classes may inherite from each other.
- Part 2. To give this objects versatility, we will add to the methods others parameters, enabling, for example, to precise if the user wants to display or not the column names, to pass in parameter a string array, corresponding to a CSS stylesheet, to display lines with differents colours, or to add for each line of the list a link to the corresponding catalog card.
- Part 3. Concerning OutilsWebBdd object, it is generally useful to display the table from the query in a sorted form. There are several criterion for the sort and it is very useful to permit to the user to sort the displayed list by clicking on the column title. To avoid an new request to the database with a GROUP BY command, we could use a Javascript code.
- Part 4. The previously made objects are only doing displaying. It is often necessary to display data from a query in a HTML data entry form to make modification on the stored table. It is needed to add methods to do it, and it is the same idea for JTables.
- Test part. This part is used during the four others parts and have for aim to show how the objects work.
To test the objects, for the Java/Swing part, we will present simply the database tables in a JInternalFrame containing JTables.
For the WEB part, we will develop a small website, for managing an student catalog.
Project files
Project files can be find here (documentation and comments in French, tar/gzip format few Kb).