Spring JdbcTemplate – Select Specific Columns From Table

Specific Columns Selection Here I am going to show you an example how to select only specific columns from a table. So you only need to select few columns from a table instead of selecting all columns. In other words you are going to fetch those columns which are required for your business purpose.

Connecting To Multiple Oracle Data Sources Using JDBC LDAP URLs

Table of Contents Introduction Why do you want to connect to multiple database Prerequisites Project Setup Application Properties DataSource Configurations DAO Class Source Code Introduction Here I am going to show you how to connect to Oracle data source using JDBC LDAP URL. I am going to create multiple data sources for connecting to multiple Oracle databases using Spring Boot…

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 And JDBC CRUD Example

Spring JDBC CRUD In my another 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 I am going…

Spring Boot – QueryForObject, QueryForList, BeanPropertyRowMapper

QueryForObject, QueryForList, BeanPropertyRowMapper In this post you will see how to select records using queryForObject(), queryForList(), BeanPropertyRowMapper in Spring Boot JdbcTemplate. Spring’s queryForObject() is used to fetch single row from the database. Spring’s queryForList() and BeanPropertyRowMapper are used to fetch multiple rows from the database. So, I will fetch single and multiple rows from the database using Spring JdbcTemplate.

Spring Security – Authentication and Role Based Authorization using JWT

Spring Security JWT Auth In this post you 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. I will implement Spring Security’s UserDetailsService to load user from database. I will use Spring…

Spring Boot Security – Form Based JDBC Authentication using UserDetailsService

Form Based Auth Using UserDetailsService 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. In this example, I will implement the form based authentication system using Spring Boot framework.

Spring Boot Security – Form Based JDBC Authentication

JDBC Based Authentication 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 I will implement here but using Spring Boot framework. In the previous example I had used Resource Bundle that will…

How to Create Annotation based Spring Application

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 using main method. This application…

Integrate H2 In-memory Database with Spring

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 like to read Integrate H2…