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