日期:2014-05-17 浏览次数:20753 次
CREATE PROCEDURE page2
@p INT,--页数
@n INT, --每页条目数
@student_cursor CURSOR VARYING OUTPUT
AS
SET @student_cursor= CURSOR FOR SELECT TOP (@n) * FROM [user] AS t WHERE t.id NOT IN(SELECT TOP ((@p-1)*(@n)) id FROM [user]);
OPEN @student_cursor;
GO
CallableStatement c = connection.prepareCall("{call page2 (?,?,?)}");
c.setInt(1, 1);
c.setInt(2, 3);
c.registerOutParameter(3,Types.OTHER);//我不知道该用什么类型,就写个OTHER吧
c.execute();
resultSet = (ResultSet) c.getObject(3);