Using ROWNUM to paginate the data in Oracle

In one of my previous posts, I showed you how to use ROWNUM with ORDER BY clause. Building on that in this post I will show you how you can paginate your results using ROWNUM in Oracle DB and how you should not paginate your data. Suppose I have a table with the following structure: … Read more

WebUI Popover – Useful wrapper over Bootstrap Popover

Github Project page: WebUI Popover. Some of the examples: To create a closeable popover: $(“#popover-elem”).webuiPopover({ content: “Closeable content”, title: “Closeable”, closeable:true }); To create a non-dismissable popover: $(“#popover-elem”).webuiPopover({ content: “Non dismissible content”, title: “Non dismissible”, dismissible: false }); Handling popover events $(‘#popover-elem’).on(‘shown.webui.popover’, function () { console.log(“Shown event!!!”); }); Few more examples can be found in … Read more

Setting up sharded mongodb cluster in localhost

I have been playing around with MongoDb, thanks to the M101J Course offered by Mongodb University. These NoSQL datastores are gaining popularity due to a number of reasons and one among them being the ease with which they can be scaled out i.e horizontal scaling. This horizontal scaling in MongoDB can be achieved by creating a sharded cluster of mongodb instances.

You might want to understand the concept of sharding before continuing. The MongoDB reference has a very clear explanation for the same here.

Read more

Getting rid of Getters and Setters in your POJO

We all have read in Java books about encapsulation of fields in Java class and also when ever you code you are asked to take special care in encapsulating the fields and providing explicit Getters and Setters. And these are very strict instructions. Lets step back a bit and find out the reason behind encapsulating … Read more

Using Google Guava Cache for local caching

Lot of times we would have to fetch the data from a database or another webservice or load it from file system. In cases where it involves a network call there would be inherent network latencies, network bandwidth limitations. One of the approaches to overcome this is to have a cache local to the application. … Read more

Very useful Console Window for windows

ConEmu (http://www.fosshub.com/ConEmu.html) is a very useful and much much better Console window for Windows. It acts as a facade over the cmd.exe. There are loads of good things in it and highly recommended for programmers who are windows users. If you have installed Cygwin, you can integrate bash with your ComEmu terminal so that you … Read more

Simple Aspect Oriented Programming (AOP) using CDI in JavaEE

We write service APIs which cater to certain business logic. There are few cross-cutting concerns that cover all service APIs like Security, Logging, Auditing, Measuring Latencies and so on. This is a repetitive non-business code which can be reused among other methods. One way to reuse is to move these repetitive code into its own … Read more

Getting started with Mocking in Java using Mockito

We all write unit tests but the challenge we face at times is that the unit under test might be dependent on other components. And configuring other components for unit testing is definitely an overkill. Instead we can make use of Mocks in place of the other components and continue with the unit testing. To … Read more

JSON Processing support in JavaEE 7 and JSR-353

JSON processing is not supported out of the box in Java. One would have to make use of 3rd part libraries to enable JSON processing. But with JSR 353 and its reference implementation JSON processing is being brought into the Java language. JavaEE 7 has already included the reference implementation. I wrote a series of … Read more

%d bloggers like this: