public void addSubscibe(List<PermedipUserSubscribeVo> list) {
        final List<PermedipUserSubscribeVo> vos=list;
          String sql="insert into permedip_user_subscribe(user_id,channel_name) values(?,?)";
          jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
            
            @Override
            public void setValues(PreparedStatement ps, int i) throws SQLException {
                ps.setInt(1, vos.get(i).getUserId());
                ps.setString(2, vos.get(i).getChannelName());
            }
            
            @Override
            public int getBatchSize() {
                return vos.size();
            }
        });
    }
View Code

相关文章:

  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案