Re: Multiple ResultSets



Hi Joe,

I have a problem again while retriveing multiple results sets from SQLServer
stored procedure
I used call.execute(), then tried to retrive OUT parameters using
call.getString(1) , it works fine
later im trying to retrive multiple resultsets one after other.
As you said first i tried to retrieve first resultset using
rs1 = call.getResultSet();
and tried to retrieve second one
call.getMoreResults()
rs2 = call.getResultSet()
But im getting rs1 and rs1 are null. Im not getting resultsets
But when i execute this stored proc using Query Analyser. It returns both
resultsets and i can see the records.
But using jdbc im not able to retrieve.
Can you tell me why??
thanks in advance
sudha





"Joe Weinstein" wrote:

>
>
> jaya nair wrote:
>
> > Hi
> > I have a stored procedure which returns mulitple resultsets
> > rs = call.executeQuery();
> > call.getMoreResults();
> > irs = call.getResultSet();
> > I want to pass these two resultsets to another method.
> > When i pass these two
> > i get error saying "ResultSet is closed" for the first resultset.
> > i came to know there is method in jdk1.4.2 which keeps the resultsets open.
> > "call.getMoreResults(Statement.Keep_Current_Result)"
> > But i tried to use that But again i have another problem
> > Im using WSAD5.1 which uses to jdk1.4.1
> > So i configured the setting in WSAD so that it uses jdk1.4.2.
> > So at compile time im not gettign any problem
> > But at runtime it says
> > "getMoreResults(int) is not supported by webshpere java.sql.Statement
> > Implementation"
> >
> > Can you please help me regarding this..
> > Thanks in Advance
>
> Hi. By JDBC spec, getMoreResults() will close any previous
> result set. You have to do whatever processing you want
> with a given resultset before getting another from the same
> statement.
>
> Joe Weinstein at BEA Systems
>
>
.



Relevant Pages

  • Problem while retrieving Multiple resultsets
    ... I have a problem again while retriveing multiple results sets from SQLServer ... later im trying to retrive multiple resultsets one after other. ... But im getting rs1 and rs1 are null. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: DataSet w/ many tables to one Datagrid
    ... > I have a dataset that calls a stored procedure within our system. ... If all the resultsets have the same number of columns, ... Bob Barrows ... Please reply to the newsgroup. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Using Subqueries in an UPDATE Statement
    ... more) resultsets and not a table or a view. ... Sylvain Lafontaine, ing. ... I have the following stored procedure and i would like to know how I ... I want to insert InvoiceAmount into a table called tbl_Case (field ...
    (microsoft.public.access.adp.sqlserver)
  • Re: no records returned from stored procedure based command when working on local temp tables
    ... When a SP executes it returns one or more Resultsets. ... Resultsets you're seeing are from the operations executed early in the SP ... > I've written a stored procedure in SQL Server 7. ... > When used in a VB application, an ADO Command object that executes the ...
    (microsoft.public.data.ado)
  • Re: Stored Procedure returning a closed recordset
    ... processes these resultsets one-at-a-time. ... Check out my ADO Examples and Best Practices ... > I'm executing a stored procedure that should return a ... > doesn't think the sproc returns any records - when it should be. ...
    (microsoft.public.data.ado)