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 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 Boot MVC JdbcTemplate CRUD Example

Introduction The primary motivation behind developing Spring Boot is to simplify the process for configuring and deploying the spring applications. Spring Boot will get rid of all the fuss involved on configuring the dependencies for building the enterprise applications. In Spring based applications, configurations are loaded with a bunch of XML files, now these configurations should not be maintained in…

Spring MVC and JDBC CRUD with zero XML

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 this tutorial you will also…

Spring MVC and JDBC CRUD Example

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 in Spring. In this example…

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 BeanPropertySqlParameterSource Example

BeanPropertySqlParameterSource 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 of its work. An…

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…