java获得mssql数据集的问题
由于最近要写一个分页的程序,在网上找了个存储过程;
create procedure add_pp_SqlPager
@sqlstr nvarchar(4000), --查询字符串
@currentpage int, --第N页
@pagesize int --每页行数
as
set nocount on
declare @P1 int, --P1是游标的id
@rowcount int
exec sp_cursoropen @P1 output ,@sqlstr,@scrollopt=1,@ccopt=1,@rowcount=@rowcount output
set @currentpage=(@currentpage-1)*@pagesize+1
exec sp_cursorfetch @P1,16,@currentpage,@pagesize
exec sp_cursorclose @P1
set nocount off
但是它返回两个数据集合,第一个是空集合。我要取第二个,请问如何用java程序取得?谢谢
取到全部结果集 放一个list里面
再判断
看我的博客里面有一个hibernate调用存储过程的例子
我不需要用hibernate啊,大哥!
1楼的可行
相关问答:
我现在想用ssh整合来做一个论坛,但数据库方面不行,我主要不会涉及数据库,不知道发帖表,和回帖表要如何设计和区分。不知道谁有一个简单的思路,来设计这些表。谢谢了。
发帖和回帖用同一张表 。发帖 id user ......
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
import java.io.*;
class FileTest
{
public static void main(String [] args) throws Exception
{
File fDir=new File(File.separator);
String strFile="java源代码测试"+File.separato ......
三个数x,y,z 比大小..
var x,y,z,t;
if (x>y)
{t=x;x=y;y=t;} //交换x,y的值
if(x>z)
{t=z;z=x;x=t;}//交换x,z的值
if(y>z)
{t=y;y=z;z=t;}//交换z,y的值
这是 ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......