Streaming bytea implementation offered

Поиск
Список
Период
Сортировка
От Werner Donné
Тема Streaming bytea implementation offered
Дата
Msg-id 6EA298B8-34D9-4832-A722-161911A22AB6@pincette.biz
обсуждение исходный текст
Ответы Re: Streaming bytea implementation offered
Список pgsql-jdbc
Hello,

I have modified version 9.1-902 of the driver in order for it to stream bytea values when calling
ResultSet.getBinaryStream().The implementation is here: 

http://www.pincette.biz/home/werner/postgresql-jdbc-9.1-902-patched.src.zip

When a bytea value is larger than 1MB it is streamed to a temporary file instead of being copied in the "answer" array.
Whenthe stream is later accessed, either with "getBinaryInputStream" or "getBytes", the bytes are fetched from the
temporaryfile, which is subsequently deleted. The "getBytes" method copies the bytes in the result array, while
"getBinaryInputStream"returns a FileInputStream with an overridden "close" method that deletes the temporary file. 

Best regards,

Werner.
--
http://www.pincette.biz/
Handling your documents with care, wherever you are.



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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: not fetching all query results
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Streaming bytea implementation offered