agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Andreas Joseph Krogh <andreas@visena.com>
To: pgsql-sql@postgresql.org
Subject: Re: BLOBs
Date: Mon, 11 Jan 2016 11:09:49 +0100 (CET)
Message-ID: <VisenaEmail.a.18468a0d72ecb60d.15230235d69@tc7-visena> (raw)
In-Reply-To: <1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

På mandag 11. januar 2016 kl. 01:37:52, skrev Eugene Yin <eugeneymail@ymail.com 
<mailto:eugeneymail@ymail.com>>:
I use the BLOB in an Oracle table to store IMG and document files. Now for 
Postgres(9.4.5), I have two options, i.e., BYTEA or OID.
 
With consideration of passing the params (SAVING) from the Java side as 
follows:
 
DiskFileItemDeepy file = myFile; InputStream is = null; long fileSize = 0; if 
(file != null && file.getFileSize() > 0){      is = file.getInputStream(); 
    fileSize = file.getFileSize();     call.setBinaryStream(1, (InputStream)is, 
(long)fileSize);
}
...
call.execute(); 
 
 
//When retrieve the data use:
 
 java.sql.Blob blob = (Blob) resultSet.getBlob(tableColumnName);  
 
 
For the purpose mentioned above, which Postgres data type is a better 
candidate for replacement the BLOB,BYTEA or OID?

 

view thread (20+ messages)  latest in thread

Message-ID: <VisenaEmail.a.18468a0d72ecb60d.15230235d69@tc7-visena>
Permalink:  ../VisenaEmail.a.18468a0d72ecb60d.15230235d69@tc7-visena/
Also on:    postgresql.org/message-id/VisenaEmail.a.18468a0d72ecb60d.15230235d69@tc7-visena

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: andreas@visena.com
  Subject: Re: BLOBs
  In-Reply-To: <VisenaEmail.a.18468a0d72ecb60d.15230235d69@tc7-visena>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox