How can i use JdbcTemplate for multiple parameters as request and response variables?

27 Views Asked by At

I am trying to create a SpringBoot web service using REST API and trying to select multiple parameters from the database table as request parameters with JdbcTemplate. How can I do that?

I know for only one parameter, I can do this;

String sql = "SELECT NAME FROM CUSTOMER WHERE ID = ?";

return jdbcTemplate.queryForObject(
        sql, new Object[]{id}, String.class);

But I want to use more than one parameter (for this instance, 'name') for the request. How can I do that? Thank you for your answers.

0

There are 0 best solutions below