public static int remove(Connection con
,String sql
,Object
... param
) throws Exception
{
ps
= con
.prepareStatement(sql
);
for (int i
=0;i
<param
.length
;i
++) {
ps
.setObject(i
+1, param
);
}
return ps
.executeUpdate();
}
public static int remove(Connection con
,StringBuffer sql
,Set
<Object> ids
) throws Exception
{
Iterator
<Object> iterator
= ids
.iterator();
while(iterator
.hasNext()){
sql
.append(iterator
.next()+",");
}
sql
.delete(sql
.length()-1, sql
.length());
sql
.append(")");
ps
= con
.prepareStatement(sql
.toString());
return ps
.executeUpdate();
}
转载请注明原文地址: https://yun.8miu.com/read-132802.html