pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedJDBC and BLOB in Postgres
2+ messages / 2 participants
[nested] [flat]
* JDBC and BLOB in Postgres
@ 2000-10-06 12:27 Didier Boudigue <didier.boudigue@nextenso.com>
2000-10-10 10:24 ` Re: JDBC and BLOB in Postgres Peter Mount <peter@retep.org.uk>
0 siblings, 1 reply; 2+ messages in thread
From: Didier Boudigue @ 2000-10-06 12:27 UTC (permalink / raw)
To: pgsql-interfaces; pgsql-interfaces@hub.org
Hi,
I'm trying Blob with JDBC Driver jdbc7.0-1.2 on postgresql 7.0.2
(Mandrake 7.1) follwing the example given in paragraph "Using Large
Objects" Chapter 58. JDBC Interface.
the getBinaryStream seems ok provided the blob is in the database,
while the setBinaryStream method call returns :
Error : InputStream as parameter not supported
Did I miss something ?
Thanks in advance.
The Code I'm using:
File file = new File("Blob.class");
FileInputStream fis = new FileInputStream(file);
cx.setAutoCommit(false);
ps = cx.prepareStatement("insert into mytable (myid, myblob) values (1,
?)");
ps.setBinaryStream(1, fis, (int) file.length());
ps.executeUpdate();
ps.close();
fis.close();
cx.commit();
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: JDBC and BLOB in Postgres
2000-10-06 12:27 JDBC and BLOB in Postgres Didier Boudigue <didier.boudigue@nextenso.com>
@ 2000-10-10 10:24 ` Peter Mount <peter@retep.org.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Mount @ 2000-10-10 10:24 UTC (permalink / raw)
To: Didier Boudigue <didier.boudigue@nextenso.com>; +Cc: pgsql-interfaces; pgsql-interfaces@hub.org
On Fri, 6 Oct 2000, Didier Boudigue wrote:
> Hi,
>
> I'm trying Blob with JDBC Driver jdbc7.0-1.2 on postgresql 7.0.2
> (Mandrake 7.1) follwing the example given in paragraph "Using Large
> Objects" Chapter 58. JDBC Interface.
>
> the getBinaryStream seems ok provided the blob is in the database,
> while the setBinaryStream method call returns :
>
> Error : InputStream as parameter not supported
>
> Did I miss something ?
No. getBinaryStream() currently reads the entire blob into a
ByteArrayInputStream, which is what it then returns.
setBinaryStream() is in 7.1
Some alternatives are in the ImageViewer example.
Peter
--
Peter T Mount peter@retep.org.uk http://www.retep.org.uk
PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
Java PDF Generator http://www.retep.org.uk/pdf/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2000-10-10 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-10-06 12:27 JDBC and BLOB in Postgres Didier Boudigue <didier.boudigue@nextenso.com>
2000-10-10 10:24 ` Peter Mount <peter@retep.org.uk>
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