cursor "jdbc_curs_1" does not exist

From: tmp(at)nitwit(dot)de
To: pgsql-jdbc(at)postgresql(dot)org
Subject: cursor "jdbc_curs_1" does not exist
Date: 2004-06-15 15:36:26
Message-ID: 200406151736.27450.tmp@nitwit.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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 );

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-06-15 16:06:26 Re: cursor "jdbc_curs_1" does not exist
Previous Message Jie Liang 2004-06-14 23:32:57 Prepare Statement