JDBC stands for Java DataBase Connectivity and is a technology for database connectivity from java program. JDBC is a collection of multiple interfaces and classes which provides methods for database connection and operations. Operations include executing SQL queries for fetching records, inserting and updating or deleting data from a database table directly from a java program. For performing any operation on a database using JDBC, requires some steps. They are :Read More →

Practical Scenario Two users are working on a project and they both are currently viewing a bug or an enhancement in a project management application. Let’s say one user knows that it is a duplicate bug while the other does not know and thinks that this needs to be done. Now one user changes its status as IN PROGRESS and the other user marks it as DUPLICATE at the same time but the request with status as DUPLICATE goes a bit early to the server and the request with status IN PROGRESS arrives later. What will be the current status?Read More →

When using Hibernate in your application, there are bright chances that you have encountered the error org.hibernate.HibernateException: No CurrentSessionContext configured!. Stack trace of the error would have been : Exception in thread “main” org.hibernate.HibernateException: No CurrentSessionContext configured! org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:690) at com.codippa.Main.main(Main.java:16)Read More →

JDBC is an acronym for Java DataBase Connectivity and is a technology for interaction of java application and its objects with a database. Hibernate on the other hand is a java based framework which also facilitates the interaction of application objects with a database but in a completely different approach. Below are listed some differences between the two. The points do not intend to indicate which is better, they just compare the various aspects of the method of operation of both. The headers before each row indicate the area of comparison.Read More →

Selecting an element of a web page means to get a reference to an element (or simply getting the element) so that actions may be performed over the element. Actions cover hiding / showing the element, removing it from the page, getting its value, getting its text, modifying its value / text etc. Examples of elements on a web page are text box, button, drop down, checkbox, radio button, span, div etc. There are 4 ways to select an element in jQuery: Using id of element, Using class of element, Using an attribute of element and its value, Using another element as a reference. WeRead More →

Soft Delete !!! What the heck ? Soft delete means that the record is not removed from the database table but a flag is set to a value which indicates that this record should not be fetched while fetching the records from this table. The flag shall be a value of a column in the table itself. For example, there is a deleted column in a table which has a value of false for a record which is newly inserted in the table but when a record is deleted, it is not removed from the table but the value of deleted column for this recordRead More →

A typical java application uses some values which are not suitable to be given in code such as log generation path, output location, configuration file path, timeout values etc. Since these values vary from system to system and user to user, their values can not be pre-fixed. One user may want his logs to be generated in “myLogs” folder, another user may want the logs to be generated in “appLogs” folder. If given in code, they cannot be changed without developer intervention. Further, this change would require a re-build of code.Read More →

There are scenarios where you want to silently post a form to server or submit a form without a page refresh. Typical example is a Facebook page where you comment on a post. When you comment, the page is not refreshed but the comment is saved somewhere on the server which means that a save request is sent without entire page submit. This involves the use of ajax. As soon as we decide to use ajax, a question arises as to how we would send form data from jsp to server without page submit and there would be a big hassle involved in form dataRead More →

Suppose we have a jsp page which has a form whose data should be sent to the server. The form has fields which are directly related to the fields of an entity on the server. An entity is a simple java class which has some fields and their getter and setter methods. Let’s say the entity is a User (which means we have a User class on the server and each field of the jsp form is linked to a field of User class. When we say linked, it simply means that the name attribute of the form element is the same as the nameRead More →