pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sven Köhler <skoehler@upb.de>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: BLOBs etc
Date: Fri, 07 Jan 2005 06:21:52 +0100
Message-ID: <41DE1C70.604@upb.de> (raw)
In-Reply-To: <Pine.BSO.4.56.0501062328590.14356@leary.csoft.net>
References: <crkrbc$t8c$1@sea.gmane.org>
	<Pine.BSO.4.56.0501062135090.10098@leary.csoft.net>
	<41DDFC46.1080807@upb.de>
	<Pine.BSO.4.56.0501062211370.25172@leary.csoft.net>
	<41DE0680.4030103@upb.de>
	<Pine.BSO.4.56.0501062258280.6327@leary.csoft.net>
	<41DE0D9B.7050104@upb.de>
	<Pine.BSO.4.56.0501062328590.14356@leary.csoft.net>

>>>The JDBC driver doesn't know what the target table looks like.  It must 
>>>blindly send data and hope it matches.  This is why the set methods can 
>>>only work for one type while the get methods could work for both.
>>
>>Is this going to be improved? Either by using serverside prepared 
>>statements or by changing the server's bahaviour somehow?
> 
> No, this was actually a design decision.  It is possible to determine the
> expected data type in many cases, but the downside is that it requires a
> network roundtrip to the server.  For simple statements this has the
> potential to nearly double execution time, so we don't want to do that.  

I see the dilemma.

> Could we perhaps do this for prepared statements we expect to reuse?  We
> could, but then you've introduced an odd inconsistency where sometimes
> things will work and sometimes they won't.

An inconsistency is not tolerable.

But still the postgresql server could accept the data generated by the 
JDBC-driver's "setBinaryStream()" even for oid columns. Isn't that the 
missing piece to make set/getBinaryStream() methods work for oid columns?

Is it known how other JDBC drivers handle this problems? Do they only 
implements set/getBinaryStream() or set/getBlob()? I'd expect 
set/getBinaryStream() to work at last, since it is the most simple way 
to get the data. I don't want to bother you any longer, if other drivers 
aren't any better, but it seems to me, like there's no unique way to get 
binary data from a database via JDBC.



view thread (23+ messages)  latest in thread

Message-ID: <41DE1C70.604@upb.de>
Permalink:  ../41DE1C70.604@upb.de/
Also on:    postgresql.org/message-id/41DE1C70.604@upb.de

 · 

reply

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: skoehler@upb.de, books@ejurka.com
  Subject: Re: BLOBs etc
  In-Reply-To: <41DE1C70.604@upb.de>
  References: <crkrbc$t8c$1@sea.gmane.org> <Pine.BSO.4.56.0501062135090.10098@leary.csoft.net> <41DDFC46.1080807@upb.de> <Pine.BSO.4.56.0501062211370.25172@leary.csoft.net> <41DE0680.4030103@upb.de> <Pine.BSO.4.56.0501062258280.6327@leary.csoft.net> <41DE0D9B.7050104@upb.de> <Pine.BSO.4.56.0501062328590.14356@leary.csoft.net> <41DE1C70.604@upb.de>

* 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