用JSP调用
DECLARE @N INT
SET @N = 0
WHILE @N < 1
BEGIN
DECLARE @NEW_ID VARCHAR(16)
EXECUTE get_new_id @NEW_ID OUTPUT
INSERT INTO [my_table] ([my_id]) VALUES (@NEW_ID)
SET @N = @N + 1
END
怎样用JSP调用上面的语句?
------解决方案--------------------
你既然已经有存储过程了,你可以去看jdbc的api,很简单的,通过Connection.prepareCall(String sql)得到 CallableStatement,然后再通过 CallableStatement对象的excute方法就可以得到结果!