TECFA||Homepage||Workpage||Table of Contents

Rapport sur Staf2x project
English Courses Grades Management (with MySQL-Servlet)


Plan of the Project

The project is intended to manipulate real-life students' grades. Therefore it is designed to offer both students and teachers access to the database but with different capabilities:

This means the teacher is able to do anything he or she wants with the grades. Thus the access must be login and password protected.

Structure of the Project

The project consists mainly three parts:

Once a student submits his or her correct login name and password, he or she will go to a page which shows exactly his or her own grades.
When a teacher submits his or her correct login name and password, he or she will go to a page which offers him or her all the capabilities mentioned above.
To make it easier for people to have a try, a "passe-par-tous" (test) is offered.

Realisation of the Project

To realise the project, eight servlets are created:

Problems Encountered and Solutions

Once the idea of the project is determined, I should choose the means or languages to realise it. It was only by chance that I chose servlet. A friend in computer science told me that Java servlet is becoming very popular now and I should learn it. Then I read some related materials besides those that Schneider gave us. I also followed the little guideline of Bertrand Resin.

Once I began writing the servlets, many problems were encountered. First of all, I had no idea of the structure of a servlet. As usual, I found some examples and then change it little by little. That means the famous "copy and paste" way. The biggest problem is that I "kill" the server several times each day. Up to now we haven't found the reason yet. It may be caused either by some errors in my servlets or by some mistakes in the server itself. Every time it happened, I have to ask either Schneider or Vivian to restart the server. Since I made quite a few servlets and I had to try each of them whenever some change is made, so it is normal that this happened many times. I didn't count after how many times I reposted data from it, the server breaks down. It seems not many.

In writing the servlets, one problem is using variables in the SQL expressions, especially the quotation marks. If they are not properly written, the data never appear. One way to get the information of errors is to add as many as possible "Exceptions", for instance, catch (SQLException ex) which will give you the information of what's wrong with your SQL expression, so you can go to check it out.

One interesting I found about servlet is that it doesn't work as a link. To put it another way, it goes only forward not backward. So each time I want the user to go back to the former page, I have to ask him or her to click the "Back" on the toolbar. Otherwise he or she has to restart from the login page. Another thing is that I intended to arrange all the files in a frame. But I didn't succeed in targetting the "form" to go to the proper frame. Thus I gave it up.

Reflection

Looking back, I find it is not so difficult as I imagined to write the horrible servlets. There is a basic structure in it. As far as this project is concerned, I had to consult all the basic MySQL expressions and the basic JDBC. In the end, I found what count are all the related JDBCs.
Thanks to Schneider and Vivian who have given me much help and encouragement.

References

Java-MySQL
Introduction à MySQL
Beginning MySQL Tutorial
JDBC Basics
Servlet Tutorial


SUN June 2000