Re: Will Connection.createBlob be implemented any time soon?

From: Tom Dunstan <pgsql(at)tomd(dot)cc>
To: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Will Connection.createBlob be implemented any time soon?
Date: 2014-01-28 01:40:03
Message-ID: CAPPfruzdcc096agROAaveNo_9XAvRcbZOD1ULB9sLNse=QkGYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Andreas

On 20 January 2014 00:11, Andreas Joseph Krogh <andreak(at)officenet(dot)no> wrote:
> I'm using JPA and need to be able to set a (new) Blob as a field, like this:
>
> val b = con.createBlob()
> val os = b.setBinaryStream(1)
> IOUtils.copyLarge(is, os, new Array[Byte](1024 * 1024))
> myEntity.setData(b)
>
> Where MyEntity has a field "data" which is of type "Blob"

I was under the impression that most JPA implementations will allow
you to stick a byte[] as your property type and will handle the rest
under the good (usually using the blob support in PreparedStatement).
Is that an option for you, or do you need the streaming functionality?

Cheers

Tom

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andreas Joseph Krogh 2014-01-28 08:09:33 Re: Will Connection.createBlob be implemented any time soon?
Previous Message Stephen Nelson 2014-01-27 22:20:46 Fwd: JDBC Maven Checksum