Re: PreparedStatement.setXXX

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: PreparedStatement.setXXX
Дата
Msg-id 42DC36AF.6060601@opencloud.com
обсуждение исходный текст
Ответ на PreparedStatement.setXXX  ("Roberta Campo" <rcampo@mm.eutelsat.org>)
Список pgsql-jdbc
Roberta Campo wrote:

> A. Using the setArray method :
> This requires the implementation of the interface java.sql.Array :
> - which methods are required in this case ?
> - is there any available implementation of this class ? :)

Someone else replied to this with an implementation..

The driver's Array support is pretty bad currently. It will only work if
the Array implementation implements:

 - getBaseTypeName() returns the underlying postgresql type name ("int")
 - toString() returns a correctly-formatted array string ("{1,2,3}")

Proper support for arbitrary Array implementations (and bare arrays via
setObject) has been on my todo list for ages but it's no longer a high
priority for our application so I doubt I'll work on it any time soon :/

> B. Using the setObject(colnumber, String, type ) method :
> This should require less implementation than the Array, shouldn't it ?
> - how to specify the type int[] ?

JDBC has no mechanism to specify a particular array type via a Types.*
constant unfortunately :(

> C. Using different drivers / protocol versions / ...

Using protocol version 2 as Dave Cramer suggests is a short-term fix but
you don't want to be using that in the longer term..

-O

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: Timestamp Conversion Woes Redux
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Timestamp Conversion Woes Redux