You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kai Hessing <ka...@hobsons.de> on 2006/07/20 18:15:38 UTC

Postgres, Cocoon and Blobs

Does anyone have an idea how I may access Blobs in a Postgres-Database
from cocoon? Using the SELECT lo_export(...) FROM ... tries to export
the Blobs on the database server and not on my application server, what
is bad (and  additionally not allowed on the DB-Server).

Thanks
Kai


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: AW: Postgres, Cocoon and Blobs

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 7/27/06, Jens Reufsteck <je...@hobsons.de> wrote:

> ...Postgres can store large objects internally and then saves only a reference
> in the actual table. The DatabaseReader retrieves the reference using
> ResultSet.getBinaryStream(). ResultSet.getBlob() retrieves the large object
> - maybe something for future improvement of the DatabaseReader?...

Thanks for the clarification!

-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


AW: Postgres, Cocoon and Blobs

Posted by Jens Reufsteck <je...@hobsons.de>.
I meanwhile tried with the DatabaseReader:

Postgres can store large objects internally and then saves only a reference
in the actual table. The DatabaseReader retrieves the reference using
ResultSet.getBinaryStream(). ResultSet.getBlob() retrieves the large object
- maybe something for future improvement of the DatabaseReader?

Thanks!

-- 
Jens Reufsteck
Hobsons GmbH
Wildunger Straße 6
60487 Frankfurt am Main
Deutschland

Tel: +49 (69) 255 37-140
Fax: +49 (69) 255 37-159

http://www.hobsons.de
http://www.hobsons.ch  

>-----Ursprüngliche Nachricht-----
>Von: news [mailto:news@sea.gmane.org] Im Auftrag von Kai Hessing
>Gesendet: Donnerstag, 27. Juli 2006 14:28
>An: users@cocoon.apache.org
>Betreff: Re: Postgres, Cocoon and Blobs
>
>Bertrand Delacretaz wrote:
>> On 7/20/06, Kai Hessing <ka...@hobsons.de> wrote:
>>> Does anyone have an idea how I may access Blobs in a 
>>> Postgres-Database from cocoon?...
>> 
>> I'm not sure if it will work out of the box for you, but the 
>> DatabaseReader should help - it uses ResultSet.getBinaryStream() to 
>> retrieve the data.
>> 
>> See 
>> 
>src/blocks/databases/java/org/apache/cocoon/reading/DatabaseReader.jav
>> a
>
>We didn't had this package in our build, but my collegue has 
>written a similiar short routine, which works as well :) Thanks.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Postgres, Cocoon and Blobs

Posted by Kai Hessing <ka...@hobsons.de>.
Bertrand Delacretaz wrote:
> On 7/20/06, Kai Hessing <ka...@hobsons.de> wrote:
>> Does anyone have an idea how I may access Blobs in a
>> Postgres-Database from cocoon?...
> 
> I'm not sure if it will work out of the box for you, but the
> DatabaseReader should help - it uses ResultSet.getBinaryStream() to
> retrieve the data.
> 
> See src/blocks/databases/java/org/apache/cocoon/reading/DatabaseReader.java

We didn't had this package in our build, but my collegue has written a
similiar short routine, which works as well :) Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Postgres, Cocoon and Blobs

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 7/20/06, Kai Hessing <ka...@hobsons.de> wrote:
> Does anyone have an idea how I may access Blobs in a
> Postgres-Database from cocoon?...

I'm not sure if it will work out of the box for you, but the
DatabaseReader should help - it uses ResultSet.getBinaryStream() to
retrieve the data.

See src/blocks/databases/java/org/apache/cocoon/reading/DatabaseReader.java

-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org