Re: Streaming blob to db

Поиск
Список
Период
Сортировка
От Jesper Thorhauge
Тема Re: Streaming blob to db
Дата
Msg-id 42C649AC.60403@conzentrate.com
обсуждение исходный текст
Ответ на Streaming blob to db  (時期 精霊 <kuon@goyman.com>)
Список pgsql-jdbc
Hi Kuon

Use the standard jdbc method on a PreparedStatement, called
setBinaryStream(..) (using version 8.0.x of the driver). The bad thing
is that getting the data out from database using getBinaryStream(..)
will use a lot of memory relative to the filesize - there seems to be no
way to avoid this. Look elsewhere in the archives for an explanation by
Oliver on this issue...

Regards
Jesper

時期 精霊 wrote:

> Hello,
>
> I got a web application that use jdbc and that will need to stream
> binary data to the database.
>
> My application need an outputstream to send the data to the db, and
> an inputstream to read the data from the db.
>
> I seeked the web but I did not found any working example.
>
> I use postgresql 8.0.1 with bytea field.
>
> The data size will be around:
>
> <1mb 50%
> 1 - 100mb 30%
> >100mb 20%
>
> Any idea of the best approach?
>
> Regards
>
> Kuon



--



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: XA support
Следующее
От: Jonas Partner
Дата:
Сообщение: Write to outputstream in PGStream blocks indefinitely