JdbcTemplate使用别名绑定变量

来源:互联网 发布:cdn网络加速是什么 编辑:程序博客网 时间:2024/04/20 16:46
MapSqlParameterSource  paramMap = new MapSqlParameterSource();NamedParameterJdbcTemplate JdbcTemplate = new NamedParameterJdbcTemplate(this.getDataSource());String[] newIds = ids.split(",");List<Long> idsList = new ArrayList<Long>();for (int i = 0; i < newIds.length; i++) {idsList.add(Long.parseLong(newIds[i]));}paramMap.addValue("ids", idsList);Integer count=JdbcTemplate.queryForInt(sql, paramMap);


0 0