Generic Concept for Working with Database.

This post is for the students anyone who is planning to their project in Java and Database. Writing the same queries and checking single quotes, double quotes, commas is tedious job. So, why not to create Generic class which generates queries automatically only by providing table name, fields and values.

Design of Add New Product Form :Add New Product

The code to be written in submit button :Submit Code

Application Layer: Product.javaProduct_Class

DatabaseLikewise you can create similar method for update, select and delete.

[Note: Instead of using String array, using ArrayList would be best.]



Legend has it that, when King Pratap Malla lost his son, his wife, the queen, was grief-stricken and would not be consoled. The king was very sad to see the condition of his beloved queen and in spite of several efforts could not lessen the grief of his wife.

Thus Pratap Malla announced that anyone who could make the queen laugh would be rewarded adequately. He also asked everyone in the valley to send a cow each for every dead relative in the family to show the queen that their son was not the only one who died.

During the festival of Gaijatra, the cow procession was brought before the grief-stricken queen. Then the participants began ridiculing and be-fooling the important people of the society. Finally, when the social injustices and other evils were highlighted and attacked mercilessly, the queen could not help but smile. The queen laughed and the king instituted a tradition of including jokes, satire, mockery and lampoon into the Gaijatra celebration. This still continues till today.

After the procession is over, in the afternoon, nearly everyone takes part in another age-old tradition in which the participants dress up and wear masks. The occasion is filled with songs and jokes. Mockery and humor of every kind become the order of the day until late in the evening. Hence, Gaijatra is a healthy festival which enables the people to accept the reality of death and to prepare themselves for life after death. According to Hinduism, “whatever a man does in his life is a preparation leading to a good life after death”.