sql3 = "update noticecert set modifydate='"+modifydate2+"',status='"+state3+"'"+
          " where certcode in('"+certAL+"')";

解决方案 »

  1.   

    这样是不行的,SQL语句不对执行不了,这是错的:update noticecert set modifydate='2005-10-01',status=0 where certcode in('[G4354J, W345435Y, a123456b, c123456f, m123456x]')
    正确的应该是:update noticecert set modifydate='2005-01-01',status=0 where certcode in ('G4354J','W345435Y','a123456b','c123456f','m123456x'),这样SQL才能正确执行啊
      

  2.   

    ArrayList certAl = (ArrayList)session.getAttribute("cert");
    if(certAll.size() > 0){
    StringBuffer sql3 = new StringBuffer("update noticecert set modifydate='" + modifydate2 + "',status=" + state3 + " where certcode in(");
     for(int i=0;i<certAL.size();i++){
     sql3.append("'" + certAL.get(i).toString() + "',");
     }
     sql3.deleteCharAt(sql3.length - 1);
     sql3.append(")");
    }
    System.out.println(sql3.toString());