pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Joseph Krogh <andreak@officenet.no>
To: pgsql-jdbc@postgresql.org
Subject: Re: Will Connection.createBlob be implemented any time soon?
Date: Tue, 28 Jan 2014 09:09:33 +0100 (CET)
Message-ID: <OfficeNetEmail.22.1c42fcfd07350176.143d7e4c23c@prod2> (raw)
In-Reply-To: <CAPPfruzdcc096agROAaveNo_9XAvRcbZOD1ULB9sLNse=QkGYA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

På tirsdag 28. januar 2014 kl. 02:40:03, skrev Tom Dunstan <pgsql@tomd.cc 
<mailto:pgsql@tomd.cc>>: Hi Andreas

 On 20 January 2014 00:11, Andreas Joseph Krogh <andreak@officenet.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?   I 
need streaming yes, that's why I use Blobs.   --
 Andreas Joseph Krogh <andreak@officenet.no>      mob: +47 909 56 963
 Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
 Public key: http://home.officenet.no/~andreak/public_key.asc  

view thread (18+ messages)  latest in thread

Message-ID: <OfficeNetEmail.22.1c42fcfd07350176.143d7e4c23c@prod2>
Permalink:  ../OfficeNetEmail.22.1c42fcfd07350176.143d7e4c23c@prod2/
Also on:    postgresql.org/message-id/OfficeNetEmail.22.1c42fcfd07350176.143d7e4c23c@prod2

 · 

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: andreak@officenet.no
  Subject: Re: Will Connection.createBlob be implemented any time soon?
  In-Reply-To: <OfficeNetEmail.22.1c42fcfd07350176.143d7e4c23c@prod2>
  References: <CAPPfruzdcc096agROAaveNo_9XAvRcbZOD1ULB9sLNse=QkGYA@mail.gmail.com> <OfficeNetEmail.22.1c42fcfd07350176.143d7e4c23c@prod2>

* 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