Friday, 21 January 2011

Simple CRUD Tutorial - Intro

This is a simple CRUD tutorial that uses only HTML, CSS, JSP and JAVA. It uses a DAO layer to access a vector as if it is a DataBAse. The following tutorial will include HSQLDB and MySQL versions by using the same DAO layer. It is written using NetBeans IDE 6.9.1.

The application has a detail screen which has six buttons for new, save, delete, next, prev, list functions. In the start up the underlying vector is initialized so that there are five records to manipulate. You can enter a new record just asif
it was a real DB but your change will be lost when you get out of the application. A further improvement could be to serialize the vector at the exit and deserialize it at the init of the application. You will find coments related to this in the code where the changes should be made.

When you click the list button a new screen is opened and you can click on a line or another till you decide which one to select. Then you can click on the View button and return back to the detail screen with your choice being displayed.

The row selection process will be simplified with two preliminary examples added into the application. These applications may be run independently by selecting and clicking run menu on them.

I will provide step by step explanation on each item till the very end. You may copy and use the code in your works on the condition that you indicate my name in the program or your references. If you are interested to have the code as a WAR file please do not hesitate to contact me at:
arsaral (at)

Kind regards.

Ali R+

Note: Source Download: Please read the paragraph above.