Posts

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…

Apache Derby Querying...

Intro...Apache derby one of the popular relational databases purely written in Java. Derby supports running in both Embedded as well as client/server models. In the embedded mode derby runs within the JVM and provides only single connection for applications, while supporting multi-threded, multi-connection and multi-user modes. In server mode derby allows multiple connections depending on the threading and mode configurations. While providing fully transactional, secure and standard (SQL, JDBC API, and Java EE) database system, still developer community is able to maintain small foot print less than 3MB for base engine and database.  Features like stored procedures, triggers, views, referential integrity constraints, multi-user capable and cost-based query optimization also supported by Apache Derby.
1. Table creation CREATE TABLE STUDENT ( REG_ID SMALLINT NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, FIRST_NAME VARCHAR(20) NOT NULL, LAST_NAME VARCHAR(…

For Better web experience - Full Screen API

Image
Some web applications may require to hide the title bar and the address bar of the browser and show it as a desktop application in full screen view, so that users get the best experience in viewing. Conventional way of doing this is to open a new window using the "window.open" method as follows.
<script type="text/javascript"> var newWindow; var url = "www.google.com"; window.onload = function (url) { newWindow = window.open(url, 'name', 'fullscreen=yes,location=0,titlebar=0,top = 0, left = 0, width = '+screen.availWidth + ', height = ' +screen.availHeight + ''); if (window.focus) {newWindow.focus()} } </script>

Using this method you can customize the new window popup by setting the properties associated with the third parameter. Get More details here

However, due to security reasons modern browsers don't allow to hide title bar and address bar anymore.Therefore alternat…

How to Use Apache JMeter for Web Services Testing...

Image
Recently, we were able to do some clustering related load testing on Apache Axis2 web services engine focusing on state replication property. I thought of sharing things we did in our tests which were carried out using Apache JMeter.

Apache JMeter is a fully open source pure java tool designed for the purpose of load testing and measuring performance of web applications. According to the documentation, it can be used to test both static and dynamic web resources such as files, Servlets, web services, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers etc. JMeter can effectively use to simulate heavy loads on the above resource types and analyze the overall performance under different load  conditions such as concurrent loads. It also provide various types of visualization techniques to graphically analyze the results obtained from the load tests.

Here are some advantages of using JMeter
Open Source free tool developed by Apache Software Foundation Has an acti…

Getting started with Apache Zookeeper...

It is a well known fact that building reliable and stable distributed applications requires considerable amount of effort and it's not that easy to maintain the properties such as High scalability, Availability, Transparency, performance of these systems. Developing high-quality, flexible, and interoperable software for distributed systems naturally involves challenging complexities and failures, since it is not much evolved and still so many areas to be explored. 
An interesting blog about "Why distributed systems are hard to program" can be found here.
Middle-ware is the bridge that connects application program and the communication infrastructure for basic message passing and support for reliable channels across different hardware and software platforms etc. 
"Apache ZooKeeper is an effort to develop and maintain an open-source server which enables highly reliable distributed coordination."
It is a centralized service for maintaining configuration information,…