求解答:sql2000下的分页问题,存储过程如下:但在jsp中是如何调用来进行分页的?
用于分页的sql2000存储过程)如下
CREATE PROCEDURE SP_GetauthorPage(
@CurrentPage int,
@PageSize int
) AS
declare @sSQL1 varchar(500)
declare @sSQL2 varchar(500)
declare @iCount int
declare @PageCount int
declare @RecordCount int
set @iCount=@CurrentPage*@PageSize
print @iCount
select @RecordCount=Count(*) from author
print @RecordCount
if @RecordCount >0
begin
if @RecordCount % @PageSize=0
begin
set @PageCount=@RecordCount/@PageSize
end
else
begin
set @PageCount=@RecordCount/@PageSize+1
end
if @CurrentPage<=@PageCount and @CurrentPage>0
begin
set @sSQL1='(select top '+ ltrim(rtrim(str(@iCount))) +' * from author order by au_lname ) as tmp'
--print @sSQL1
set @sSQL2='select top ' +ltrim(rtrim(str(@PageSize)))+' * from '+@sSQL1 +' order by au_lname desc '
print @sSQL2
EXEC(@sSQL2)
end
else
begin
select top 0 * from author
end
end
else
begin
select * from author
end
GO
这个过程已在本机上执行通过。
问题:
1.在jsp中是如何调用这个存储过程的?
2.具体的是怎样让数据显示出来的(下一页,上一页)。
哪位高手有源程序啊。