Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group