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

    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
    at com.sybase.jdbc2.jdbc.SybResultSet.checkResultSet(
    at nl.boek123.jspbeans.ContingentBean.contingentInlez en(
    at nl.boek123.jspbeans.ContingentBean.getContingentDa ta(
    at java.lang.reflect.Method.invoke(Native Method)
    at com.sssw.srv.jsp.AgoJspHelper.invokeGetter(AgoJspH
    at com.sssw.srv.jsp.AgoJspHelper.getBeanProperty(AgoJ
    at com.sssw.gen.jsp.contingent_jsp_575758508._jspServ ice(
    at com.sssw.srv.jsp.AgoHttpJspPage.service(AgoHttpJsp
    at com.sssw.srv.resources.AgWarResource.doServletDisp atch(
    at com.sssw.srv.resources.AgWarResource.service(AgWar
    at com.sssw.srv.resources.AgWarURLResource.perform(Ag
    at com.sssw.srv.http.httpd.perform(
    at com.sssw.srv.http.Client.processRequest(Client.jav a:906)
    at com.sssw.srv.http.Client.loop(
    at com.sssw.srv.http.Client.runConnection( :1470)

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

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

    ... set other parameters

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

    if (rs.isBeforeFirst()) moreResults =;
    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
    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