create procedure RankBoard
@RankType int,
@cur_rank cursor varying output
as
begin
if(@RankType=0)
set @cur_rank = cursor forward_only static for
select articleID,articleTitle,click
from BlogArticles
order by click desc
else if(@RankType=1)
set @cur_rank = cursor forward_only static for
select userID,uname,numOfVisit
from BlogUser
order by numOfVisit desc
else if(@RankType=2)
set @cur_rank = cursor forward_only static for
select BlogComment.articleID,articleTitle,count(BlogComment.articleID)
from BlogComment,BlogArticles
where BlogComment.articleID=BlogArticles.articleID
group by BlogComment.articleID,articleTitle
order by count(BlogComment.articleID)
open cur_rank
end
存储过程如上所示,求JDBC调用返回的游标结果集的方式,万分感谢❤
看你上面这样写应该是需要在别的存储过程中调用这个游标是吧,你可以参考一下这篇文章http://greatwqs.iteye.com/blog/1446787