List传参方式

举个例子 sql = "select * from table where id=? and param=?"; sql中的参数要用?形式,然后使用list.add(param) 向list中添加这个参数,最后通过jdbcTemplate.queryForList查询方式,将sql和list加入方法中就可以了。

Map传参方式

使用NamedParameterJdbcTemplate;

sql例子:select * from table where id = :param; map.put("param",param);

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2021-07-04
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-09-26
  • 2022-01-20
  • 2022-12-23
相关资源
相似解决方案