pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Henri-Pierre CHARLES <hpc@prism.uvsq.fr>
To: pgsql-interfaces@hub.org
Subject: Trouble with large objets and jdbc
Date: Wed, 12 May 1999 13:35:57 +0200
Message-ID: <19990512133557.A24315@gibet.prism.uvsq.fr> (raw)

Hello,

I want to use large objets to store images in a database with the jdbc
interface. I have try to use PreparedStatement which has
setBinaryStream () but it's not possible with the old version I
usually use (6.4.2). I have download the 6.5b1 and unfortunately
setBinaryStream () is still not implemented.

I have tried to store the uuencoded image in a text field but they are
a strict limitation of 8190 byte for a field, which is too small.

I have tried to use LargeObjects, with no luck. The example.blobtest
fail. I have join the error message at the end of this mail (I use
postgresql 6.5b1 on a FreeBSD 3.0 computer)

example.ImageViewer sometime fail

Somebody can help ?

Thanks 

-- 
% Henri-Pierre.Charles@prism.uvsq.fr PRiSM, Université de Versailles
% Tel: 01 39 25 43 44        45, Av. des États Unis 78000 Versailles
% Il reste 58982399 secondes jusqu'au 01/01/2000


>java -Djdbc.driver=postgresql.Driver example.blobtest jdbc:postgresql:test anonymous ""
PostgreSQL blobtest v6.3 rev 1

Connecting to Database URL = jdbc:postgresql:test
Connected...Now creating a statement

----------------------------------------------------------------------
Testing postgresql large object api

Gaining access to large object api
Test 1 Creating a large object

Creating a large object
Opening test source object
Copying file to large object
Block size=2048 offset=0
Block size=2048 offset=2048
Block size=2048 offset=4096
Block size=413 offset=6144
Closing object
Test 2 Reading a large object and save as a file

Opening large object 18785
Opening test destination object
Copying large object to file
Exception caught.
java.sql.SQLException: IOError while reading from backend: java.io.IOException: The backend has broken the connection. Possibly the action you have attempted has caused it to close.
java.sql.SQLException: IOError while reading from backend: java.io.IOException: The backend has broken the connection. Possibly the action you have attempted has caused it to close.
        at postgresql.PG_Stream.ReceiveChar(PG_Stream.java:183)
        at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:114)
        at postgresql.fastpath.Fastpath.fastpath(Fastpath.java:188)
        at postgresql.largeobject.LargeObject.seek(LargeObject.java:207)
        at postgresql.largeobject.LargeObject.size(LargeObject.java:250)
        at example.blobtest.ownapi_test2(blobtest.java:144)
        at example.blobtest.ownapi(blobtest.java:77)
        at example.blobtest.<init>(blobtest.java:50)
        at example.blobtest.main(blobtest.java:188



view thread (2+ messages)  latest in thread

Message-ID: <19990512133557.A24315@gibet.prism.uvsq.fr>
Permalink:  ../19990512133557.A24315@gibet.prism.uvsq.fr/
Also on:    postgresql.org/message-id/19990512133557.A24315@gibet.prism.uvsq.fr

 · 

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-interfaces@postgresql.org
  Cc: hpc@prism.uvsq.fr, pgsql-interfaces@hub.org
  Subject: Re: Trouble with large objets and jdbc
  In-Reply-To: <19990512133557.A24315@gibet.prism.uvsq.fr>
  References: <19990512133557.A24315@gibet.prism.uvsq.fr>

* 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