public void deleteCatalog(String FatherID){ int tempData=0; sql="select fatherID,linkstr,AncestorID from catalog where productID="+FatherID; rs=conn.execute(sql); try{ if(rs.next()){ tempData=rs.getInt("fatherID"); LinkStr=rs.getString("linkstr"); AncestorID=rs.getString("AncestorID"); }
try{rs.close();} catch(Exception e){ System.out.println(e); } sql="delete from catalog where ProductID="+FatherID; // out.println(sql); try{ conn.execute(sql); }catch(Exception e){ System.out.println(e); } sql="delete from catalog where linkstr like ′′"+LinkStr+"%′′ and AncestorID="+AncestorID; //out.println(sql); try{ conn.execute(sql); }catch(Exception e){ System.out.println(e); } sql="update catalog set ChildNum=ChildNum-1 where productID="+tempData; //out.println(sql); try{ conn.execute(sql); }catch(Exception e){ System.out.println(e); } }catch(Exception e){ System.out.println(e); } } //end public
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn