Re: Will Connection.createBlob be implemented any time soon?

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Will Connection.createBlob be implemented any time soon?
Дата
Msg-id lbgk12$252$1@ger.gmane.org
обсуждение исходный текст
Ответ на Will Connection.createBlob be implemented any time soon?  (Andreas Joseph Krogh <andreak@officenet.no>)
Ответы Re: Will Connection.createBlob be implemented any time soon?  (Andreas Joseph Krogh <andreak@officenet.no>)
Список pgsql-jdbc
Andreas Joseph Krogh wrote on 19.01.2014 14:14:
> $subject
> It'd be nice to be able to do:
>                  val b = con.createBlob()
>                  val os = b.setBinaryStream(1)
>                  IOUtils.copyLarge(is, os, new Array[Byte](1024 * 1024))
> Is there a work-around for it?

Using PreparedStatement.setBinaryStream() works without problems.
You don't even need the intermediate Blob instance:

PreparedStatement pstmt = con.createStatement("....");

pstmt.setBinaryStream(1, is);
   or
pstmt.setBinaryStream(1, is, length);  // if the length is known




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

Предыдущее
От: Andreas Joseph Krogh
Дата:
Сообщение: Will Connection.createBlob be implemented any time soon?
Следующее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: Will Connection.createBlob be implemented any time soon?