Spring JdbcNamedParameterTemplate Junit Mockito

Introduction In the tutorial, Spring NamedParameterJdbcTemplate and MapSqlParameterSource Example, I had shown how to save new record in the database and how to fetch record from database. Here I am going to show you how to mock Spring JdbcNamedParameterTemplate SqlParameterSource with Junit Mockito. I am going to use Junit 5 framework for this example. I am also using Mockito framework…

Spring Boot MVC with Tiles and AJAX

In my previous tutorials I have shown how to create a Spring Boot MVC application, here I will show you how to create an AJAX based Spring Boot MVC application with Tiles. What is Tiles (https://tiles.apache.org/) A free open-sourced templating framework for modern Java applications. Based upon the Composite pattern it is built to simplify the development of user interfaces….

Spring NamedParameterJdbcTemplate And Collections.singletonMap Example

NamedParameterJdbcTemplate and Collections.singletonMap 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 JdbcTemplate to do…

Spring NamedParameterJdbcTemplate and MapSqlParameterSource Example

Introduction In this post I will show you how to use NamedParameterJdbcTemplate and MapSqlParameterSource to execute query for inserting or retrieving results from database table. The NamedParameterJdbcTemplate class adds support for programming JDBC statements using named parameters, as opposed to programming JDBC statements using only classic placeholder (?) arguments. An SqlParameterSource is a source of named parameter values to a…