NamedParameterJdbcTemplate

The JdbcTemplate uses an index to specify the values of the parameters in SQL, which makes it complicated to remember the parameters with their indexes. If you are uncomfortable with numbers, or more number of parameters to set, we can use NamedParamterJdbcTemplate, which facilitates the use of named parameters to specify the parameters in SQL. Each parameter will have a named prefixed with a colon(:). Traditionally, in JDBC, we used ? as a placeholder while writing the query. We will see the syntax shortly while developing the code.

Let's demonstrate these templates one by one.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.22.169