In a career of java developement , we come across many simple techniques, which might look simple to many
but are difficult for others to use. Just for example , it took me around two months to get idea of how to create my first database (jdbc) class.
Point to Remember when create a simple database driven project in Netbeans
It might be useful for some , who doesnt package their project properly. Follow the following directory structure- db [all database code goes here]
- beans[all definition of beans goes here]
- ui[this is user interface part.Developed in swing or jsp]
- name (string)
- roll (string )
- address (string)
- phone (string)
How to create classes
Stage #1- Create classes for every tables in database.Its better to maintain a direct mapping between java classs property and database table column.
- Create a constructor (public) with no arg
- Place these beans classes in beans package.
- boolean addStudent(beans.Student std)
- boolean editStudent(beans.Student std)
-
ArrayList
searchStudent(String criteria)