Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    40

    Unanswered: Error scrolling Sybase resultset

    I'm calling a stored proc on Sybase.
    When trying to move to the first row in the resultset the following Exception is generated:

    java.sql.SQLException: JZ0R0: ResultSet has already been closed.
    at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(Erro rMessage.java:436)
    at com.sybase.jdbc2.jdbc.SybResultSet.checkResultSet( SybResultSet.java:1479)
    at com.sybase.jdbc2.jdbc.SybResultSet.next(SybResultS et.java:112)
    at nl.boek123.jspbeans.ContingentBean.contingentInlez en(ContingentBean.java:317)
    at nl.boek123.jspbeans.ContingentBean.getContingentDa ta(ContingentBean.java:149)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.sssw.srv.jsp.AgoJspHelper.invokeGetter(AgoJspH elper.java:265)
    at com.sssw.srv.jsp.AgoJspHelper.getBeanProperty(AgoJ spHelper.java:193)
    at com.sssw.gen.jsp.contingent_jsp_575758508._jspServ ice(contingent_jsp_575758508.java:492)
    at com.sssw.srv.jsp.AgoHttpJspPage.service(AgoHttpJsp Page.java:92)
    at com.sssw.srv.resources.AgWarResource.doServletDisp atch(AgWarResource.java:944)
    at com.sssw.srv.resources.AgWarResource.service(AgWar Resource.java:723)
    at com.sssw.srv.resources.AgWarURLResource.perform(Ag WarURLResource.java:114)
    at com.sssw.srv.http.httpd.perform(httpd.java:4592)
    at com.sssw.srv.http.Client.processRequest(Client.jav a:906)
    at com.sssw.srv.http.Client.loop(Client.java:1266)
    at com.sssw.srv.http.Client.runConnection(Client.java :1470)
    at com.sssw.srv.http.Client.run(Client.java:1430)
    at java.lang.Thread.run(Thread.java:484)

    The Exception occurs on the first call to next() on the ResultSet.

    CallableStatement cst = con.prepareCall("{?=call contingent_info(?,?,?,?,?,?)}");
    cst.registerOutParameter(1,Types.VARCHAR);
    cst.setInt(2, user.getVerkoopkantoor());

    ... set other parameters

    ResultSet rs = cst.executeQuery();
    boolean moreResults = false;

    if (rs.isBeforeFirst()) moreResults = rs.next();
    while (moreResults)
    {
    ...
    }

    Anyone know what's happening here? Seems the ResultSet is being returned closed by Sybase, but when executing the stored procedure from an SQL prompt it returns some 70 rows.

  2. #2
    Join Date
    Apr 2003
    Posts
    40
    OK, found the answer at last (had been bugging me since friday morning).

    Retrieving the resultvalue from the stored procedure seems to close the resultset (any idea why this happens?).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •