JdbcTemplate使用别名绑定变量
2016-02-22 17:50
218 查看
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);
相关文章推荐
- 大型分布式网站架构
- 死刑犯和CEO写给母亲的信,价值上亿!惊醒无数父母!
- linux访问windows共享文件夹的两种方法
- Leetcode Minimum Height Trees
- 取消tableviewcell选中效果
- 10位世界级投资大师100金句
- MySQL中TPS和QPS的计算方式
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- Charles抓包使用教程
- css行级行内元素横向居中
- 寒假集训四之判断长方形问题 hdu5258 暴力枚举
- iOS中使用AVPLayer自定义视频播放器
- Android实现3D页面加载进度条动画
- ASP.NET应用程序与页面生命周期
- OnClick事件的Sender参数的前世今生——TWinControl.WinProc优先捕捉到鼠标消息,然后使用IsControlMouseMsg函数进行消息转发给图形子控件(意外发现OnClick是由WM_LBUTTONUP触发的)
- 分析cocos2d-x在Android上的编译过程(1):cocco2d-x是怎样生成的Android的文件夹结构
- 改动分区后,导致linux上不了
- angularjs中判断ng-repeat是否迭代完
- [置顶] 我不想与我不能
- 增大Vmware虚拟机中Ubuntu系统磁盘空间的方法