X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 304DD52899 for ; Tue, 7 Jun 2005 16:16:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45160-02 for ; Tue, 7 Jun 2005 19:16:06 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 2AB375280F for ; Tue, 7 Jun 2005 16:16:05 -0300 (ADT) Received: (qmail 5087 invoked by uid 1112); 7 Jun 2005 19:15:59 -0000 Date: Tue, 7 Jun 2005 14:15:59 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Sathyajith G Cc: pgsql-jdbc@postgresql.org Subject: Re: exception while upgrading driver In-Reply-To: <9648E4D3482.000004D1sathyajith@inbox.com> Message-ID: References: <9648E4D3482.000004D1sathyajith@inbox.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.01 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/24 X-Sequence-Number: 12986 On Tue, 7 Jun 2005, Sathyajith G wrote: > i have the following code running without any errors with postgres 7.4.2. > driver. > > String qry="select ...; > > try{ > ResultSet rs=Data.getResultSet(qry); > while(rs.next()) > > I changed the driver to postgres 8.0.1. Strangely now, the above code gives > the exception "The resultset is closed". Please help. > I suspect your Data.getResultSet() method looks something like this: Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql); stmt.close(); return rs; This is not a legal thing to do, closing the Statement also closes the ResultSet that was created by it. The 7.4 driver did not correctly check this, but the 8.0 version does. You most postpone the Statement close until you are done with the ResultSet. Kris Jurka