Introduction In my other tutorial I had shown how to create an example on Spring MVC and JDBC CRUD example using annotations only, but here I am going to use Spring Boot framework. I did not update the other tutorial keeping in mind if someone still needs the example using Spring framework only. Here also…

Posted in Spring Boot Spring JDBC Spring MVC Spring Transaction

Spring Boot MVC and JDBC CRUD Example

Introduction In this post we will see how to select records using queryForObject, queryForList, BeanPropertyRowMapper in Spring JdbcTemplate. Here we will create annotation based example. If you need XML based application then you can refer to the example here. Spring’s queryForObject is used to fetch single row from the database. Spring’s queryForList and BeanPropertyRowMapper are…

Posted in Spring Core Spring JDBC

Select Records using queryForObject, queryForList, BeanPropertyRowMapper in Spring JdbcTemplate

Introduction In this post we will see an example on Spring Security authentication and role based authorization using JWT (JSON Web Token) on REST or RESTful services. I won’t explain here about JWT as there is already very good article on JWT. We will implement Spring Security’s UserDetailsService to load user from database. We will…

Posted in Spring Boot Spring JDBC Spring Security

Spring Security – Authentication and Role Based Authorization using JWT

Introduction The example Spring Boot Security form based JDBC authentication using UserDetailsService will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based JDBC authentication using UserDetailsService on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. In the previous example…

Posted in Spring Boot Spring JDBC Spring Security

Spring Boot Security – Form Based JDBC Authentication using UserDetailsService

Introduction The example, Spring Boot Security form based JDBC authentication, will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based jdbc authentication on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. In the previous example we had used Resource…

Posted in Spring Boot Spring JDBC Spring Security

Spring Boot Security – Form Based JDBC Authentication

Introduction We will see how to create annotation based Spring application or annotation based configuration in Spring application. We will use here H2 database to perform database activities using Spring JDBC Template. We will not use any XML configuration here or zero XML configuration. We will also see how to run this stand-alone Spring application…

Posted in Spring Core Spring JDBC

How to Create Annotation based Spring Application

Introduction This tutorial will show you how to integrate in-memory H2 database with Spring. We will see here simple example to understand how it works. Here we will use Spring JDBC API to perform database activities. You can use this example with Spring based applications, such as, Spring Core, Spring MVC etc. You may also…

Posted in Spring Core Spring JDBC

Integrate H2 In-memory Database with Spring

Introduction This tutorial will show you how you can define multiple datasources in Spring Boot application. I had shown how to define multiple datasources in Spring application, but here I will define multiple datasources in Spring Boot application. There may be situations where you need to define multiple datasources in Spring Boot application. For instance,…

Posted in Spring Boot Spring JDBC

Define Multiple DataSources in Spring Boot

In my other tutorials Spring MVC CRUD example with JDBC Spring MVC and Spring JDBC Example ,  Spring MVC and JDBC CRUD Example  I have used XML configurations but in this tutorial I have used only Annotation, so it means it uses zero XML configurations. This example shows how MVC(Model, View, Controller) works in Spring 4.x. In…

Posted in Spring JDBC Spring MVC

Spring MVC and JDBC CRUD with zero XML

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

Posted in Spring JDBC Spring MVC

Spring MVC and JDBC CRUD Example

Introduction In this post I will show you how to use NamedParameterJdbcTemplate and Collections.singletonMap to execute query for returning result. The NamedParameterJdbcTemplate class adds support for programming JDBC statements using named parameters, as opposed to programming JDBC statements using only classic placeholder (?) arguments. The NamedParameterJdbcTemplate class wraps a JdbcTemplate, and delegates to the wrapped…

Posted in Spring JDBC

Spring NamedParameterJdbcTemplate and Collections.singletonMap Example

In this post I will show you how to use NamedParameterJdbcTemplate and BeanPropertySqlParameterSource to execute query. The NamedParameterJdbcTemplate class adds support for programming JDBC statements using named parameters, as opposed to programming JDBC statements using only classic placeholder (?) arguments. The NamedParameterJdbcTemplate class wraps a JdbcTemplate, and delegates to the wrapped JdbcTemplate to do much…

Posted in Spring JDBC

Spring NamedParameterJdbcTemplate and BeanPropertySqlParameterSource Example