In this video, we will learn to fetch data from the database. So far in this spring jdbc course, we have covered insert, delete and batch update. Now it’s time for the most important select operation(Spring CRUD - Read).

So Let’s read data by using jdbctemplate’s query method. We will also learn how to query for an individual object by using jdbctemplate’s queryForObject method.

Note that to perform a select operation using jdbctempalte, We have to understand a concept called RowMapper. The RowMapper is going to help us to fetch database records in form of a resultset. Using the RowMapper’s mapRow method we can also bind our DB record with our domain(POJO) class object.

The rowmapper fetch the complete resultset and make it available inside the maprow method one by one so that we don’t have to manually loop over the resultset.

Once we understand the RowMapper concept, we will understand Spring’s Row mapper implementation called BeanProeprtyRowMapper. It is going to help us to bind our database resultset with our domain class object without even writing a custom row mapper.

Timestamp:

Introduction : 00:00
Spring JDBC Select - Gameplan : 01:52
Spring JDBC perform a batch update: 08:29
Spring CRUD - Read Data from the database: 12:53
Spring Framework (JDBC) : QueryForObject : 37:13
Why BeanPropertyRowMapper (concept) : 44:09
Let’s code- BeanPropertyRowMapper:49:18

#spring 

Fetch Data From The Datab with Spring Jdbc
1.35 GEEK