X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 298C23A4D78 for ; Fri, 7 Jan 2005 05:20:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62989-01 for ; Fri, 7 Jan 2005 05:20:04 +0000 (GMT) Received: from mailgate.uni-paderborn.de (mailgate.uni-paderborn.de [131.234.22.32]) by svr1.postgresql.org (Postfix) with ESMTP id 0775E3A4B63 for ; Fri, 7 Jan 2005 05:20:02 +0000 (GMT) Received: from p5484bde7.dip.t-dialin.net ([84.132.189.231] helo=gwinet.sven.home-net) by mailgate.uni-paderborn.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.43) id 1CmmX3-0001kC-AE; Fri, 07 Jan 2005 06:19:29 +0100 Received: from [10.1.1.20] (unknown [10.1.1.20]) by gwinet.sven.home-net (Postfix) with ESMTP id 6E6B969F7A4; Fri, 7 Jan 2005 06:19:53 +0100 (CET) Message-ID: <41DE1C70.604@upb.de> Date: Fri, 07 Jan 2005 06:21:52 +0100 From: =?ISO-8859-15?Q?Sven_K=F6hler?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a4) Gecko/20040927 X-Accept-Language: de, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: BLOBs etc References: <41DDFC46.1080807@upb.de> <41DE0680.4030103@upb.de> <41DE0D9B.7050104@upb.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-UNI-PB_FAK-EIM-MailScanner-Information: Please see http://imap.uni-paderborn.de for details X-UNI-PB_FAK-EIM-MailScanner: Found to be clean X-UNI-PB_FAK-EIM-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.208, required 4, AUTH_EIM_USER -5.00, RCVD_IN_NJABL_DUL 1.66, RCVD_IN_SORBS_DUL 0.14) X-MailScanner-From: skoehler@upb.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/39 X-Sequence-Number: 11919 >>>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.