日期:2014-05-20 浏览次数:20734 次
CREATE PROCEDURE [del_user] (@id [int]) AS Begin DELETE FROM [UserTest] WHERE id=@id End GO
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; }