在以下 jdbctemplate 示例中,我将如何指定“age”参数的值?
String sql = "SELECT * FROM CUSTOMER where age = ? ";
List<Customer> customers = new ArrayList<Customer>();
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
List<Map> rows = jdbcTemplate.queryForList(sql);
for (Map row : rows) {
Customer customer = new Customer();
customer.setCustId((Long)(row.get("CUST_ID")));
customer.setName((String)row.get("NAME"));
customer.setAge((Integer)row.get("AGE"));
customers.add(customer);
}
return customers;