pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Satish Burnwal (sburnwal) <sburnwal@cisco.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: How to use JDBC to update LargeObject
Date: Thu, 21 Jan 2010 10:20:53 -0500 (EST)
Message-ID: <alpine.BSO.2.00.1001211018050.25745@leary.csoft.net> (raw)
In-Reply-To: <3A8C969225424C4D8E6BEE65ED8552DA89D6E5@XMB-BGL-41C.cisco.com>
References: <3A8C969225424C4D8E6BEE65ED8552DA89D653@XMB-BGL-41C.cisco.com>
	<4B5808C5.4050906@enterprisedb.com>
	<3A8C969225424C4D8E6BEE65ED8552DA89D6E5@XMB-BGL-41C.cisco.com>



On Thu, 21 Jan 2010, Satish Burnwal (sburnwal) wrote:

> Even setBlob() method seems to be updating large object only partially.

If you want to reuse an existing blob you need to truncate it first:

http://java.sun.com/javase/6/docs/api/java/sql/Blob.html#truncate(long)

Note that there is a bug with truncate in all but the CVS JDBC drivers 
that prevents you from truncating a blob to zero length.  Released 
drivers can only truncate down to one byte, but that's probably fine for 
you at the moment.

Kris Jurka




view thread (6+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.1001211018050.25745@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.1001211018050.25745@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.1001211018050.25745@leary.csoft.net

 · 

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: books@ejurka.com, sburnwal@cisco.com, heikki.linnakangas@enterprisedb.com
  Subject: Re: How to use JDBC to update LargeObject
  In-Reply-To: <alpine.BSO.2.00.1001211018050.25745@leary.csoft.net>
  References: <3A8C969225424C4D8E6BEE65ED8552DA89D653@XMB-BGL-41C.cisco.com> <4B5808C5.4050906@enterprisedb.com> <3A8C969225424C4D8E6BEE65ED8552DA89D6E5@XMB-BGL-41C.cisco.com> <alpine.BSO.2.00.1001211018050.25745@leary.csoft.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