Spring MVC and JDBC CRUD Example

This tutorial Spring MVC and JDBC CRUD example shows how MVC(Model, View, Controller) works in Spring 4.x. In this tutorial you will also find how JDBC works with Spring MVC. We will also see how annotation like @Autowired works in Spring MVC and JDBC CRUD example. You will also see how datasource is configured in Spring. This example shows how to integrate Spring 4 with Maven 3. You may also read Spring MVC and Spring JDBC Example

Spring MVC and JDBC CRUD with zero XML

For Spring MVC and JDBC CRUD example, we will create maven based web 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.

Prerequisites

The following configurations are required in order to run the application

Eclipse Kepler
JDK 1.8
Tomcat 8
Have maven 3 installed and configured
Spring 4 dependencies in pom.xml

Now we will see the below steps how to create a maven based project in Eclipse. Continue reading “Spring MVC and JDBC CRUD Example”

Spring Web MVC

This tutorial will show you how we configure Spring MVC, maven and Tomcat 7. For this tutorial we will create maven based web 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. Continue reading “Spring Web MVC”

Call Stored Procedure using Spring StoredProcedure

This tutorial will show you how we can stored procedure using Spring SimpleJdbcCall. 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.

Sometimes we need to call a stored procedure while a single SQL statement is unable to fulfil our requirements because, it permits to execute multiple SQL statements and it also allows us to execute these SQL statements in a transactional unit in an efficient manner to avoid any inconsistency sometimes occurs during the execution of multiple SQL statements. Continue reading “Call Stored Procedure using Spring StoredProcedure”

Call Stored Procedure using Spring SimpleJdbcCall

This tutorial will show you how we can stored procedure using Spring SimpleJdbcCall. 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.

Sometimes we need to call a stored procedure while a single SQL statement is unable to fulfil our requirements because, it permits to execute multiple SQL statements and it also allows us to execute these SQL statements in a transactional unit in an efficient manner to avoid any inconsistency sometimes occurs during the execution of multiple SQL statements. Continue reading “Call Stored Procedure using Spring SimpleJdbcCall”

Define Multiple DataSources in Spring

This tutorial will show you how we can get a list of data sources using Spring framework. We will define multiple datasources in Spring. There may be situations where we need to define multiple datasources in Spring application.

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.

Continue reading “Define Multiple DataSources in Spring”

Batch Insert using Spring JdbcTemplate

This tutorial will show you how we can insert a large dataset into a database at once using Spring JdbcTemplate. 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.

Sometimes we 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 application’s performance. Spring provides batch operations with the help of JdbcTemplate, it inserts or updates records into database in one shot. Continue reading “Batch Insert using Spring JdbcTemplate”

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.

Prerequisites

The following things are required in order to run the application

Eclipse Helios
JDK 1.6
Have maven installed and configured
Spring dependencies in pom.xml

Now we will see the below steps how to create a maven based spring project in Eclipse
Continue reading “Injecting properties value in Spring”