Re: Re: Not able to insert array of integers into column of type integer array

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Re: Not able to insert array of integers into column of type integer array
Дата
Msg-id 506A4464.6090602@ringerc.id.au
обсуждение исходный текст
Ответ на Re: Not able to insert array of integers into column of type integer array  (pprotim <pprotim80@yahoo.com>)
Список pgsql-jdbc
pprotim: It looks like you tried to reply here, but just posted the
quoted original message.

I've been looking at the JDBC standard to see if PgJDBC can legally
accept arrays of primitive types and strings, not just java.sql.Array .
While this is something that the standard does not require it seems to
be something people expect the driver to do, and something other drivers do.

If you work with and have tested with other drivers it'd be helpful to
know how they behave for as many different drivers as you have access to.

--
Craig Ringer

On 10/02/2012 12:08 AM, pprotim wrote:
>
> ------------------------------------------------------------------------
> *From:* Stefan Reiser [via PostgreSQL] <[hidden email]>
> *To:* pprotim <[hidden email]>
> *Sent:* Wednesday, September 26, 2012 9:40 PM
> *Subject:* Re: Not able to insert array of integers into column of type
> integer array
>
> When setting or updating arrays in a ResultSet or PreparedStatement you
> can't use java array types (Integer[], ...) -- they need to be wrapped
> in a "java.sql.Array". This is done using the Connection-object.
>
> here's an example with Floats:
>
>      Connection con = // your connection
>      Double[] dbArr =  // ... some java array
>      Array sqlArray = con.createArrayOf("float8", dbArr);
>
> Now "sqlArray" can be used with setArray() (or even setObject() ).
> (not sure where, but there were some other examples in the JDK-docs or
> pg-JDBC-docs ...)


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

Предыдущее
От: the6campbells
Дата:
Сообщение: Re: data set combination of integer and decimal/numeric returns wrong result type
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: data set combination of integer and decimal/numeric returns wrong result type