Large objects + JDBC

From: Marcin Mazurek - Multinet SA - Poznan <m(dot)mazurek(at)multinet(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: Large objects + JDBC
Date: 1999-12-12 17:31:59
Message-ID: Pine.BSF.3.96.991212182541.20684A-100000@arka
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I'm put several gifa into a table. I did as a exercise:) form psql using:
INSERT INTO images (id, data)
VALUES (3, lo_import('/usr/local/apache/servlets/images/a.gif'));

but I have a problem with creating Java stream to read these data. Here
serveral lines of code I was using:
PreparedStatement ps=db.prepareStatement("select oid from imag where id=?");
ps.setInt(1,1);
ResultSet rs = ps.executeQuery();
rs.next();
InputStream is = rs.getBinaryStream(0);
and nothing happens:( Several messages from exceptions:
[13/12/1999 18:11:04:815 CET] ShowImageServlet1: 0
null
Fastpath: ERROR: lo_tell: large object descriptor (-1) out of range

Anybody know how to read LargeObjects with java?
btw I read about postgres JDBC extensions LargeObject and
LargeObjectManager and everthing would be great except nobody mentioned
that they are not completely implemented:)
Anybody can send me a small exapmle how to read these data?
mazek

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 1999-12-13 03:04:12 radius.detaillog -> pgsql parser?
Previous Message R.J. 1999-12-12 13:57:33 Index of words form a field.