From: Jeffrey Tenny <jeffrey.tenny@comcast.net>
To: postgres jdbc <pgsql-jdbc@postgresql.org>
Subject: ResultSet.getBinaryStream nothing more than a ResultSet.getBytes() call?
Date: Mon, 04 Oct 2004 19:17:03 -0400
Message-ID: <4161D9EF.9030202@comcast.net> (raw)
I've been working to minimize the memory footprint of my application.
I was under the impression that ResultSet.getBinaryStream would be more
efficient than getBytes(). Certainly the documented semantics imply
that that is a goal (since you must process the InputStream from
getBinaryStream before the call to ResultSet.next() or even processing
the next column.
But the following trace from a java heap profile suggests
that we're still just copying the bytes from the resultset as with
getBytes() instead
of streaming the ones already in memory, though perhaps it's because
I'm using a read(buf) call on the stream.
Anybody got an authoritative answer? Or if you point me at a 8.0DEV
driver tarball I'll look myself, but I don't run CVS and couldn't find a
tarball on gborg.
TRACE 18107:
org.postgresql.util.PGbytea.toBytes(PGbytea.java:29)
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBytes(AbstractJdbc2ResultSet.java:1986)
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBinaryStream(AbstractJdbc2ResultSet.java:2115)
org.apache.commons.dbcp.DelegatingResultSet.getBinaryStream(DelegatingResultSet.java:221)
Thanks...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: jeffrey.tenny@comcast.net
Subject: Re: ResultSet.getBinaryStream nothing more than a ResultSet.getBytes() call?
In-Reply-To: <4161D9EF.9030202@comcast.net>
References: <4161D9EF.9030202@comcast.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox