Batch Insert using Spring JdbcTemplate

This tutorial will show you how you can insert a large dataset or perform batch insert into a database at once using Spring JdbcTemplate. Sometimes you need to insert or update large number of records in the database. It’s not a good idea to insert multiple records into database one by one in a traditional approach. It will hit the…

Comparator interface in Java

We will see what is comparator interface and how to use comparator interface in Java programming language. For more information please go through http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html A comparison function, which imposes a total ordering on some collection of objects. Comparator can be passed to a sort method (such as Collections.sort() or Arrays.sort()) to allow precise control over the sort order. Comparator can…

Comparable interface in Java

For more information please go through http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html This interface imposes a natural ordering on objects of each class that implements it and the class’s compareTo method is referred to as its natural comparison method. Lists or arrays of objects that implement this interface can be sorted automatically by Collections.sort or Arrays.sort respectively. Objects that implement this interface can be used…

Gson Jackson To Map JSON To POJO And POJO To JSON

Introduction This tutorial will show you how you can map JSON string to a list of POJO objects and a list of POJO objects to JSON string using Google API’s Gson as well as Jackson API’s ObjectMapper. I will create nested POJO objects from JSON string or JSON string to nested POJO objects using both Gson and Jackson API.

ArrayList vs LinkedList in Java

List ArrayList and LinkedList are two popular concrete implementations of List interface from Java’s popular Collection framework. Being List implementations both ArrayList and LinkedList are ordered, index based and allows duplicate. In this tutorial we will discuss what are the similarities and differences found between ArrayList and LinkedList.

Shallow Copy And Deep Copy In Java

Shallow Copy/Deep Copy Shallow Copy also means Shallow Clone and Deep Copy also means Deep Clone. Cloning an object is about creating the copy of the original object, i.e., making an identical copy of the original object. By default, cloning in Java is field by field copy i.e. as the Object class does not have idea about the structure of…

Cucumber framework with Mule ESB

What is Mule ESB ? Mule ESB is a lightweight Java-based enterprise service bus (ESB) and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data. Mule ESB enables easy integration of existing systems, regardless of the different technologies that the applications use, including JMS, Web Services, JDBC, HTTP, and more. This example…

Send email attachment using SMTP in Mule ESB

What is Mule ESB ? Mule ESB is a lightweight Java-based enterprise service bus (ESB) and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data. Mule ESB enables easy integration of existing systems, regardless of the different technologies that the applications use, including JMS, Web Services, JDBC, HTTP, and more. This example…

Injecting properties value in Spring

This tutorial will show you how we can auto inject value from properties file in Spring. For this tutorial we will create a standalone maven project in Eclipse. If you already have an idea on how to create a maven project in Eclipse will be great otherwise I will tell you here how to create a maven project in Eclipse….

Calculate Future or Past date in PHP

This tutorial will show you how can you calculate either future date from a particular date to “plus a number of given days” or past date from a particular date to “minus a number of given days”. Future or past date calculation may be required for various purposes such as to calculate the age of a person on future date…