Posts

Showing posts from 2014

Dive into Oracle : Data Grouping and Merging

Image
In this post we are going to discuss about commonly used Oracle database queries for manipulate data mainly grouping and merging. If the database structure is normalized and when it comes to visualization of data, it is required to group data based on their common characteristics. Similarly in most of the database systems including Oracle, Merging is the functionality provided in order to migrate data between two databases, schema or tables.
Let's create a simple database structure as follows. We can use a tool like SQL Fiddle to run queries and see how it works. Make sure you have selected Oracle 11g R2 as DB type before running any queries.
CREATE TABLE SEMISTER_GPA( STUDENT_ID VARCHAR2(8), SEMISTER_ID VARCHAR2(4), GPA NUMBER(5,4), PRIMARY KEY (STUDENT_ID,SEMISTER_ID) );
Adding some values to above tables.

INSERT INTO SEMISTER_GPA(STUDENT_ID,SEMISTER_ID,GPA) VALUES ('ST000001','L1S1',3.5245); INSERT INTO SEMISTER_GPA(STUDE…

Http Session creation and Destroy events...

HttpSession is one of the commonly used way of identifying users across multiple requests between clients and servers. In order to provide various services such as authentication, authorization etc. for users and to store user information, logging and audit purposes, it is required to keep track of newly created sessions, active sessions and session destroy events. HttpSessionListener interface in servlet API provides methods to receive session events for its implementation classes published by the servlet container.
Lets look at a sample class 'WebSessionListener' which implements "HttpSessionListener" interface.
import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class WebSessionListener implements HttpSessionListener { //Notification that a session was created. @Override public void sessionCreated(HttpSessionEvent httpSessionCreatedEvent) { } //Notification that a session is about to b…