Re: Cursornames

From: Barry Lind <blind(at)xythos(dot)com>
To: Kim Ho <kho(at)redhat(dot)com>
Cc: pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Cursornames
Date: 2003-08-06 05:54:13
Message-ID: 3F309805.9020602@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Patch applied.

thanks,
--Barry

PS. I would still like the mentioned addition to the test suite to
check for this case.

Kim Ho wrote:
> This fixes the behaviour that Felipe Schnack noticed.
>
> The logic goes, if the statement name is null (which happens when you do
> not use cursors or server prepared statements), then we have already
> fetched all the rows, and there are no more.
>
> Cheers,
>
> Kim
>
>
> ------------------------------------------------------------------------
>
> Index: org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java,v
> retrieving revision 1.13
> diff -c -p -r1.13 AbstractJdbc1ResultSet.java
> *** org/postgresql/jdbc1/AbstractJdbc1ResultSet.java 30 Jun 2003 21:10:55 -0000 1.13
> --- org/postgresql/jdbc1/AbstractJdbc1ResultSet.java 4 Aug 2003 21:32:11 -0000
> *************** public abstract class AbstractJdbc1Resul
> *** 131,136 ****
> --- 131,138 ----
> String[] binds = new String[0];
> // Is this the correct query???
> String cursorName = statement.getStatementName();
> + if (cursorName == null)
> + return false;
> sql[0] = "FETCH FORWARD " + fetchSize + " FROM " + cursorName;
> QueryExecutor.execute(sql,
> binds,
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message felipes 2003-08-06 13:12:35 Re: setFetchSize() bug
Previous Message Barry Lind 2003-08-06 05:40:46 Re: [HACKERS] PostgreSQL JDBC driver Connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE)