power520243
会飞的小咸鱼
2017-09-10 15:18

请问有大神知道JDBC调用sql server 中带游标返回参数的存储过程的方法吗

  • jdbc
  • 存储
  • sql

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调用返回的游标结果集的方式,万分感谢❤

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换