Insert\Update using NamedParameterJDBCTemplate in Spring framework
In the post Insert\Update using JDBCTemplate in Spring framework we have already seen how JDBCTemplate can be used in Spring framework for data access. If you have noticed the examples, in the SQL...
View ArticleSelect query using NamedParameterJDBCTemplate in Spring framework
In the post Insert\Update using NamedParameterJDBCTemplate in Spring framework I have already discussed how NamedParameterJDBCTemplate can be used for inserting and updating data in the DB. In this...
View ArticleUsing Spring profiles to switch environment
While developing an application its very common to switch environments. As example while developing an application we may use different DB configuration, in QA environment another set of DB...
View ArticleUsing Conditional annotation in Spring framework
In some cases you do want to conditionally enable or disable a complete @Configuration class, or even individual @Bean methods. One common example of this is to use the @Profile annotation to activate...
View ArticleJava Stream API Examples
In the post Stream API in Java 8 we have already got an introduction of Stream API. A Stream can be defined as a sequence of elements supporting sequential and parallel aggregate operations. Using...
View ArticleRun time injection using Spring Expression Language(SpEL)
Spring Expression Language (SpEL) is available from Spring 3, it is a powerful expression language and provides an option for runtime injection rather than hardcoding values. Using SpEL you can inject...
View ArticleUsing p-namespace for shorter XML in Spring
If you have worked on Spring and used XML configuration for wiring beans you would have used <property> element several times for providing property values and/or providing reference for beans....
View ArticleReduction Operations in Java Stream API
Stream API contains many terminal operations (such as average, sum, min, max, and count) that return one value by combining the contents of a stream. These operations are called reduction operations...
View ArticleParallel Stream in Java Stream API
You can execute streams in serial or in parallel. When a stream executes in parallel, the Java runtime partitions the stream into multiple sub-streams. Aggregate operations iterate over and process...
View ArticlePrimitive type streams in Java Stream API
If you have gone through the post Stream API in Java 8 one thing you would have noticed is that Streams work on object references. They can’t work on primitive types because of that many times people...
View ArticleMap operation in Java Stream API
Map operations, as the name suggests, are used to do the element mapping from one stream to another. Map operation will return a stream consisting of the results of applying the given function to the...
View ArticleCollecting in Java Stream API
Collect method is used to perform a mutable reduction operation on the element of the given stream.A mutable reduction operation can be defined as an operation that accumulates input elements into a...
View ArticleFlatMap in Java
If you know about the mapping operation in Java stream, in mapping operation the given function is applied to all the elements of the stream. Where as flattening a structure, in simple terms, means...
View ArticleSpliterator in Java
Spliterators, like iterators, are for traversing the elements of a source. The source of elements covered by a Spliterator could be, for example, an array, a Collection, an IO channel, or a generator...
View ArticleUsing c-namespace in Spring
If you have worked on Spring and used XML configuration for wiring beans you would have used <constructor-arg> element several times for providing, property values and/or providing reference for...
View ArticleUsing util-namespace for wiring collection in Spring
Spring provides util-namespace that helps in dealing with common utility configuration issues, such as configuring collections, referencing constants. Mostly I use it for wiring collection and this...
View ArticleUsing depends-on attribute in Spring
If one bean is a dependency of another that usually means that one bean is set as a property of another. In Spring framework, typically you accomplish this with the <ref/> element in XML-based...
View ArticleGenerics in Java
There have been many new feature additions in Java over the year, with introduction of lambda expression in Java 8 it has even moved toward functional programming. But long before the lambda...
View ArticleArray in Java
An array in Java is a container object that holds values of a single type. These elements are stored in a contiguous memory location and referred by a common name. Note that this common name (variable)...
View ArticleMatrix Multiplication Java Program
When you multiply two matrices with each, you actually do a “dot product” of rows and columns.As example if you are multipying a 3X3 matrix with a 3X2 matrix -Matrix multiplicationThe result you get...
View Article