Re: How to use JDBC to update LargeObject

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Satish Burnwal (sburnwal)" <sburnwal(at)cisco(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to use JDBC to update LargeObject
Date: 2010-01-21 15:20:53
Message-ID: alpine.BSO.2.00.1001211018050.25745@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-01-21 15:22:23 Re: Java equivalent data type for chkpass.
Previous Message Saurabh Jain 2010-01-21 14:47:29 Java equivalent data type for chkpass.