pst = conn.prepareStatement(sql);
for(Msg msg:msges){
pst.setString(index++, msg.getId());
pst.setString(index++, msg.getPublisher());
pst.setString(index++, msg.getReceiver());
pst.setString(index++, msg.getBody());
pst.setString(index++, msg.getTime());
pst.setString(index++, msg.getState());
pst.setString(index++, msg.getType());
pst.addBatch();
}
pst.executeBatch();
String sql = "delete from " + TAB + " b" + " where b." + ID + "=?";
pst = conn.prepareStatement(sql);
for(String uid:ids){
pst.setString(1, uid);
pst.addBatch();
}
pst.executeBatch();