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 C7EC2D1B1C8 for ; Tue, 15 Jun 2004 12:36:41 -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 32026-07 for ; Tue, 15 Jun 2004 15:36:33 +0000 (GMT) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [62.67.200.165]) by svr1.postgresql.org (Postfix) with ESMTP id 6C142D1B7D8 for ; Tue, 15 Jun 2004 12:36:31 -0300 (ADT) Received: (qmail 2780 invoked from network); 15 Jun 2004 15:36:29 -0000 Received: from unknown (HELO tcn.local) (652696@[217.231.225.30]) (envelope-sender ) by smtprelay04.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 15 Jun 2004 15:36:29 -0000 Received: from localhost (localhost [127.0.0.1]) by tcn.local (Postfix) with ESMTP id 0613F3688 for ; Tue, 15 Jun 2004 17:36:28 +0200 (CEST) From: tmp@nitwit.de To: pgsql-jdbc@postgresql.org Subject: cursor "jdbc_curs_1" does not exist Date: Tue, 15 Jun 2004 17:36:26 +0200 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200406151736.27450.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/52 X-Sequence-Number: 10254 Hi! org.postgresql.util.PSQLException: ERROR: cursor "jdbc_curs_1" does not exist Can somebody explain this exception? What I do is pretty simple: I read text from one table, gzip it and insert it into another table. But it seems that the exception is thrown at ResulSet.next() but I'm not sure. Here's the code anyway: final PreparedStatement select = f4t.prepareStatement( "SELECT urlid, html FROM html" ); final PreparedStatement insert = f4t.prepareStatement( "INSERT INTO legacy.zhtml (id, zhtml) VALUES (?, ?)" ); f4t.setAutoCommit( false ); select.setFetchSize( FETCH_SIZE ); int i = 0; for( ResultSet row = select.executeQuery(); row.next(); ) { final String id = row.getString( "urlid" ); final String html = row.getString( "html" ); final ByteArrayOutputStream bos = new ByteArrayOutputStream(); final DataOutputStream dos = new DataOutputStream( bos ); WritableUtils.writeCompressedString( dos, html ); insert.setString( 1, id ); insert.setBytes( 2, bos.toByteArray() ); insert.execute(); System.out.print( '.' ); if( ++i % 100 == 0 ) { System.out.println(); f4t.commit(); } } f4t.commit(); f4t.setAutoCommit( true );