Re: Array support

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Array support
Дата
Msg-id Pine.BSO.4.56.0504280921150.30994@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Array support  (Thomas O'Dowd <tom@uwillsee.com>)
Ответы Re: Array support  (Thomas O'Dowd <tom@uwillsee.com>)
Список pgsql-jdbc

On Thu, 28 Apr 2005, Thomas O'Dowd wrote:

> 1. I tried to use the syntax ARRAY['one'] in the string returned by
> toString(). This fails with the server error:
>
>     array value must start with "{" or dimension information
>
> So it looks like that format is not supported by server side prepared
> statements.

Right, the ARRAY[] syntax is part of the parser which doesn't get invoked
on parameters, so you need to use the {} format.

> 2. How do you set an array to null? I tried:
> PreparedStatement.setNull(index, java.sql.Types.ARRAY);
> but it throws the exception
>
> org.postgresql.util.PSQLException: Unknown Types value.
> at org.postgresql.jdbc2.AbstractJdbc2Statement.setNull(AbstractJdbc2Statement.java:1003)
>
> Q: How do I set an array column to null using a PreparedStatement?

This is indeed a bug, I've fixed this in the 8.0 + head branches.  Updated
jar files are available here:

http://www.ejurka.com/pgsql/jars/tod/

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Statement Timeout and Locking
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: _pg_keyposition is gone in HEAD