Aug 25, 2018

Spring NamedParameterJdbcTemplate

NamedParameterJdbcTemplate

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.

You can also pass along named parameters and their corresponding values to a NamedParameterJdbcTemplate instance by using the Map-based style.

 Map<String, String> namedParameters = Collections.singletonMap("first_name", firstName);