Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1750406
  • 博文数量: 600
  • 博客积分: 10581
  • 博客等级: 上将
  • 技术积分: 6205
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 10:13
文章分类
文章存档

2016年(2)

2015年(9)

2014年(8)

2013年(5)

2012年(8)

2011年(36)

2010年(34)

2009年(451)

2008年(47)

分类: Java

2009-01-06 17:42:29

  sql = "";
  sql = "insert into  TBL_CMF_USERTELBOOK values (?,?,?,?,sysdate,sysdate,?,?)";
  BatchPreparedStatementSetter batchpss = new BatchPreparedStatementSetter() {
   public int getBatchSize() {
    return telBooks.size();
   }
   public void setValues(PreparedStatement ps, int index)
     throws SQLException {
    TelBook telBook = new TelBook();
    telBook = telBooks.get(index);
    ps.setLong(1, telBook.getAccountId());
    ps.setString(2, telBook.getContactNum());
    ps.setLong(3, telBook.getIsValidate());
    ps.setInt(4, 1);
    ps.setLong(5, telBook.getFriendId());
    ps.setString(6, telBook.getFriendName());
   }
  };
  this.getJdbcTemplate().batchUpdate(sql, batchpss);
阅读(1842) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~