stmt.execute()返回值仅影响{ }中的代码是否执行,并不能决定是否执行EXECUTE,
EXECUTE一定执行

解决方案 »

  1.   

    是的
    try{
                 if(!stmt.execute()){ HH_msg+="您已成功地添了项目"+p_item_code+"!<br>";}
       
         }catch(Exception e){
           HH_msg+="添了项目"+p_item_code+"失败,请重新添加!<br>";
             }
    原程序是这样的
      

  2.   

    当用 if(!stmt.execute())时 { } 中的代码会执行
    而用 if(stmt.execute())时 { } 中的代码不会执行!!这是怎么回事 难道 stmt.execute() 返回的是 false ??????????????