哦,上面写错了:
...
ResultSet rst = cst.executeQuery();//这个地方如果用execute()的话,结果总为false。
//总是第一个查询结果。

解决方案 »

  1.   

    仅仅是测试用的。
    如果是这样:
    CREATE PROCEDURE [dbo].[testP] AS
    delete from systemdepartmentInfo where sdinPArentID=11222
    select * from systemdepartmentInfo
    .....中间一些处理,最后需要返回后面这句
    select * from systemuserinfo怎么办?
      

  2.   

    JDBC可以一次得到多个数据集,然后用next()方法到得每个数据集的,在《JSP深入编程》还是在《JSP高级编程》中我看到过,具体是哪一本就忘记了,那两本书是希望出版社的。
      

  3.   

    用cst.execute()方法
    Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet. 
    There are no more results when the following is true:      // stmt is a Statement object
         ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
      

  4.   

    to chn217(天涯) :
    我也试过,但一设CallableStatement cst = conn.prepareCall(sql, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);时,cst.execute返回值总为false,cst.getResultSet就总为null了。