waterye

Preview of new JDBC features for Spring 1.3

支持命名参数查询
public List getPreferredBeer() {
    Map 
params = new HashMap(2);
    
params.put("unwantedBrand""Heineken");
    
params.put("maxPrice"new BigDecimal(25.00));
    List l 
= getJdbcTemplate().queryForList(
      
"select id, price, brand from beers " +
      
"where price < :maxPrice and brand <> :unwantedBrand",
      
params);
    
return l;
  }


Preview of new JDBC features for Spring 1.3

posted on 2005-08-25 20:45 waterye 阅读(536) 评论(3)  编辑  收藏 所属分类: spring

Feedback

# re: Preview of new JDBC features for Spring 1.3 2005-08-25 21:25 江南白衣@ITO

希望spring能继续吸收o/r broker,ibatis的优点,成为非orm时的首选简单方案。不过说实话,命名参数这功能好简单,两三个小时就够实现了,1.3才加进来显得有点晚啦~~~~  回复  更多评论   

# re: Preview of new JDBC features for Spring 1.3 2005-08-25 21:34 Water Ye@ITO

ActiveMapper的作者Thomas Risberg写的
到时Spring Jdbc用于查询, ActiveMapper用于cud, 是种不错的方案
  回复  更多评论   

# re: Preview of new JDBC features for Spring 1.3 2005-08-25 21:37 江南白衣@ITO

ActiveMapper前天的CVS好象又动了一下,但进度还是慢阿~~~~.  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: