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 7A216D1B7C1 for ; Tue, 15 Jun 2004 13:54:08 -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 81490-01 for ; Tue, 15 Jun 2004 16:54:07 +0000 (GMT) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [62.67.200.164]) by svr1.postgresql.org (Postfix) with ESMTP id 4B564D1B7CC for ; Tue, 15 Jun 2004 13:54:04 -0300 (ADT) Received: (qmail 21907 invoked from network); 15 Jun 2004 16:54:03 -0000 Received: from unknown (HELO tcn.local) (652696@[217.231.225.30]) (envelope-sender ) by smtprelay03.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 15 Jun 2004 16:54:03 -0000 Received: from localhost (localhost [127.0.0.1]) by tcn.local (Postfix) with ESMTP id 72A363647 for ; Tue, 15 Jun 2004 18:53:59 +0200 (CEST) From: tmp@nitwit.de To: pgsql-jdbc@postgresql.org Subject: Re: cursor "jdbc_curs_1" does not exist Date: Tue, 15 Jun 2004 18:53:58 +0200 User-Agent: KMail/1.6.2 References: <200406151736.27450.tmp@nitwit.de> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406151853.58666.tmp@nitwit.de> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME, RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200406/55 X-Sequence-Number: 10257 On Tuesday 15 June 2004 18:06, you wrote: > The problem here is that you commit every 100 rows. A commit closes any > open cursors, so the next time you try to call next the cursor isn't there > any more. Hmm. And why does this code work then: for( int j = 1; row.next(); j++ ) { String id = row.getString( "id" ); URL url = new URL( row.getString( "url" ) ); Timestamp time = row.getTimestamp( "timestamp" ); try { insertUrls.setString( 1, id ); insertUrls.setString( 2, url.toString() ); insertUrls.setString( 3, resp.getText() ); insertUrls.execute(); } catch( Exception e ) { System.err.println( e ); } finally { if( j % 100 == 0 ) { System.out.println(); f4t.commit(); } } }