Single and Multiple Records Insert using Spring JdbcTemplate

Records Insertion Using Spring Jdbc Template This tutorial will show you how you can insert an object or multiple objects into a database using Spring JdbcTemplate. So you are going to see how to insert single record and multiple records into database table. I am going to use PreparedStatement and BatchPreparedStatementSetter for inserting multiple records. Sometimes you need to insert…

Embedded HSQL Database with Spring

Introduction This tutorial will show you how you can work with embedded HSQLDB with Spring framework. This application will show you a CRUD (Create, Read, Update and Delete) operation using embedded HSQLDB. Sometimes you need to work with an in memory database when you want to demonstrate certain database centric features of an application during development phase. Such situation may…

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…

Spring MVC and Spring JDBC Example

Introduction This tutorial shows an example on how MVC (Model, View, Controller) works in Spring framework. In this tutorial you will also find how JDBC (Java Database Connectivity API) works with Spring MVC. We will also see how annotation like @Autowired works in Spring. You will also see how datasource is configured in Spring. This example shows how to read…