Re: cursor "jdbc_curs_1" does not exist

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

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-06-15 17:38:26 Re: cursor "jdbc_curs_1" does not exist
Previous Message Jie Liang 2004-06-15 16:44:03 Re: [SQL] Prepare Statement