java调用删除存储过程出错?更新,插入都可以,高手看看有代码
java调用删除存储过程出错?更新,插入都可以,高手看看有代码
删除存储过程
CREATE PROCEDURE [del_user] (@id [int])ASBeginDELETE FROM [UserTest] WHERE id=@idEndGO
public String userDel(int id) { String userDel = null; try { CallableStatement proc = null ; proc = con.prepareCall("{ call del_user(?) }"); proc.setInt(1,id); proc.executeUpdate(); proc.close(); con.close(); userDel = "ok"; } catch(Exception e){ System.out.println(e.toString()); userDel = "sorry"; } return userDel; }