Collection Element List in Spring

Collection Element List With this example I will show you how to inject List elements in Spring application. The collection type I am going to show you is List or Array. I am going to use Spring Boot framework. I will show you various ways of loading a list of configurable properties in Spring application. The list of elements you…

Working with Collection Element Props in Spring Application

With this example I will show you how to inject Collections type Props in Spring applications. This is similar to the element type Map I had shown in another example. I am going to use Spring Boot framework but I will show you both using application.properties file as well as traditional XML config file to configure the props elements. In…

Deploy Web Application in Jetty Container in Embedded Mode

Introduction This tutorial is all about to deploy a web application in embedded Jetty web container. Therefore, you do not need to deploy it manually into the external web server. Sometimes, you need to deploy the application in embedded mode, because during unit testing or integration testing you need to deploy the web application manually every time before you start…

Call Stored Procedure Using Spring StoredProcedure

Stored Procedure This tutorial will show you how you can call stored procedure using Spring StoredProcedure. I assume you have a basic idea about stored procedure and what a stored procedure does and what are the advantages of using stored procedure in database server. Related Posts: Sometimes you may need to call a stored procedure while a single SQL statement…

Call Stored Procedure using Spring SimpleJdbcCall

Simple Jdbc Call This tutorial will show you how you can call or execute stored procedure using Spring SimpleJdbcCall. SimpleJdbcCall API provides flexible methods to invoke stored procedure. You can use DataSource directly with SimpleJdbcCall or you can create JdbcTemplate using DataSource and use JdbcTemplate with SimpleJdbcCall API for calling the stored procedures. You can also use RowMapper or BeanProprtyMapper…

Define Multiple DataSources in Spring

Introduction This tutorial will show you how you can get a list of data sources using Spring framework. I will define multiple datasources in Spring. There may be situations where you need to define multiple datasources in Spring application. Why do you need multiple DataSource? You might need to connect to multiple different databases from your same application. Then you…

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…

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….

Simple Spring Batch Example

What is Spring Batch In this tutorial I will show you how Spring Batch works by an example. The example will import data from a CSV (Comma Separated Value) file and transform with custom code and finally saves the result into another CSV file. Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch…

Spring Boot Data JPA Unidirectional Many-To-One Relationship

Introduction In unidirectional association, you will have navigation only in one direction, i.e, only one side of the association will have the reference to the other side. The one side of the association will implement one of the collection interfaces, if it has the reference to the other entity. In many to one relationship, multiple source objects can have relationship with…