标签:
public void addDeptList(List<Dept> paramList) throws Exception{
Connection conn = DBUtil.getConn();
PreparedStatement ps= conn.prepareStatement("insert into dept values(?,?,?)");
for(Dept d:paramList){
ps.setInt(1, d.getDeptno());
ps.setString(2, d.getDname());
ps.setString(3, d.getLoc());
ps.addBatch();
}
ps.executeBatch();
DBUtil.close(conn, ps);
}
标签:
原文地址:http://www.cnblogs.com/hwgok/p/5932202.html