Thread: Fwd: Patch for streaming resultsets

Fwd: Patch for streaming resultsets

From
"Patric Bechtel"
Date:
==================BEGIN FORWARDED MESSAGE==================
>From: "Patric Bechtel" <bechtel@ipcon.de>
>To: "pgsql-jdbc@postgresql.org" <pgsql-jdbc@postgresql.org>
>Date: Thu, 02 Jan 2003 17:33:44 +0100
>Reply-To: "Patric Bechtel" <bechtel@ipcon.de>
>Priority: Normal
>X-Mailer: PMMail 2000 Professional (2.20.2502) For Windows 2000 (5.1.2600;1)
>MIME-Version: 1.0
>Content-Type: multipart/mixed; boundary="_=_=_=IMA.BOUNDARY.H83I08138764=_=_=_"
>Subject: Patch for streaming resultsets
>

Hello folks,

I've made a patch against the current CVS version of the JDBC driver,
which, based upon Nick Ferrier's patch (thanks!), which adds
streaming result sets to the driver.
I've made some modifications to the build file, too, as in it's
current version it's not able to build clean for JDBC3. I think
I fixed that.
Another thing I added are three properties which can be included
inside the URL:

 defaultFetchSize=<int>

sets the fetch size default to <int>.

 forceFetchSize=<boolean>

in case this property is true, the driver ignores all setFetchSize()
API calls from the application. It can be used to get apps, which
"know" the postgres driver, work though... :-)

 useServerPrepare=<never|always>

This on alters the behaviour of server prepared statements. The
default behaviour is that PreparedStatement's DO get prepared
on server side, and normal Statement's do NOT.
Setting this property to "never" switches server side preparation
off completely, whereas setting it to always even makes
normal Statements prepared ones (which can be nice in case of
ever and ever repeated queries such as queue lookups).

Please note that some parts of the source are commented out
for now, as I did not find a way to accomplish the declaration
of a cursor for a prepared statement. As for now, this seems
to be a feature in upcoming 7.3.2/7.4. But as soon as one of
these arrive, we just twig out these comments and there we go...

The patch is, as mentioned above, against the most actual CVS
version. A single file, PGResultSet.java, belongs into the
org/postgresql directory; it needs to be added to the
repository.

Again, a big thank you for Nick Ferrier, as he made the first
version of this; I cleaned it up and tested it quite
thoroughly, our own app as all of the test cases seem to work
flawlessly with it. It seems that I've broken not too much... :-)

have fun,

Patric




===================END FORWARDED MESSAGE===================



Attachment

Re: Fwd: Patch for streaming resultsets

From
Nic Ferrier
Date:
> I've made a patch against the current CVS version of the JDBC driver,
> which, based upon Nick Ferrier's patch (thanks!), which adds
> streaming result sets to the driver.
> I've made some modifications to the build file, too, as in it's
> current version it's not able to build clean for JDBC3. I think
> I fixed that.

It built ok with jdbc3 for me.

IMHO the build does need fixing, I've had a few conversations with
Barry about it and I hoped to make some changes once my patch was
accepted.


> Another thing I added are three properties which can be included
> inside the URL:
>
>  defaultFetchSize=<int>
>
> sets the fetch size default to <int>.
>
>  forceFetchSize=<boolean>
>
> in case this property is true, the driver ignores all setFetchSize()
> API calls from the application. It can be used to get apps, which
> "know" the postgres driver, work though... :-)
>
>  useServerPrepare=<never|always>
>
> This on alters the behaviour of server prepared statements. The
> default behaviour is that PreparedStatement's DO get prepared
> on server side, and normal Statement's do NOT.
> Setting this property to "never" switches server side preparation
> off completely, whereas setting it to always even makes
> normal Statements prepared ones (which can be nice in case of
> ever and ever repeated queries such as queue lookups).
>
> Please note that some parts of the source are commented out
> for now, as I did not find a way to accomplish the declaration
> of a cursor for a prepared statement. As for now, this seems
> to be a feature in upcoming 7.3.2/7.4. But as soon as one of
> these arrive, we just twig out these comments and there we go...
>
> The patch is, as mentioned above, against the most actual CVS
> version. A single file, PGResultSet.java, belongs into the
> org/postgresql directory; it needs to be added to the
> repository.

You're patch doesn't seem to include the PGRefCursorResultSet stuff
for allowing refcursor return values from procs to be mapped to
ResultSets. Including this necessitates an additional file which
declares an interface to represent refcursor ResultSet types.

That was part of my original patch, I think it would be easier from a
release management point of view if you patched my patch.


> Again, a big thank you for Nick Ferrier, as he made the first
> version of this; I cleaned it up and tested it quite
> thoroughly, our own app as all of the test cases seem to work
> flawlessly with it. It seems that I've broken not too much... :-)

Well done for doing this... I hope these changes get accepted soon, I
am already using them and it seems you found them useful as well.


Nic