String []results = request.getParameterValues("checkbox");
if(results != null){
all_id = "(";
li_count = 1;
for(int i = 0 ; i< results.length; i ++)
{
if(i==0)
{all_id = all_id + results[i];}
else
{all_id = all_id + "," + results[i];}
};
all_id = all_id + ")";
//out.println(all_id);
Statement stmt=conn.createStatement();
String sql_del = "delete from news where id in " + all_id;
int i_del = stmt.executeUpdate(sql_del);
if(results != null){
all_id = "(";
li_count = 1;
for(int i = 0 ; i< results.length; i ++)
{
if(i==0)
{all_id = all_id + results[i];}
else
{all_id = all_id + "," + results[i];}
};
all_id = all_id + ")";
//out.println(all_id);
Statement stmt=conn.createStatement();
String sql_del = "delete from news where id in " + all_id;
int i_del = stmt.executeUpdate(sql_del);
解决方案 »
- 为什么创建对象时失败
- 带井号的文件无法下载怎么办
- org.hibernate.exception.GenericJDBCException: could not initialize a collection
- jsp 翻页查询 数据传递
- 客户端和服务器时间同步的问题
- 有用过润乾报表的吗?急问!
- JavaBean提取表单null值问题
- 列表框控制的问题,高分求助
- [初学者问题]请教:有什么地方有小程序可以供我学习?
- 新浪微博开放平台 批量获取标签为什么只返回第一个人的标签 求大牛解决啊!!
- 分不清楚JSP 和javascript??
- JSP怎么写Cookies并设置保存时间为一年?(Cookies保存路径怎么设置?如果在WINDOWS下用的话怎样保存在WINDOWS的Cookies目录里?)
{
if(document.body.all[i].type=="checkbox" )document.body.all[i].checked=ob0.checked;
}
}
if(!rs.equals(null)){
all_id = "(";
li_count = 1;
for(int i = 0 ; i< rs.size(); i ++)
{
String item = (String)iter.next();
if(i==0)
{all_id = all_id + item;}
else
{all_id = all_id + "," + item;}
};
all_id = all_id + ")";
//out.println(all_id);
Statement stmt=conn.createStatement();
String sql_del = "delete from news where id in " + all_id;
int i_del = stmt.executeUpdate(sql_del);没来的急测试,意思能理解就行了