Re: helo

Поиск
Список
Период
Сортировка
От Wappler, Robert
Тема Re: helo
Дата
Msg-id C8E2DAF0E663A948840B04023E0DE32A0260B5E6@w2k3server02.de.ophardt.com
обсуждение исходный текст
Ответ на helo  (beulah prasanthi <itsbeulah@gmail.com>)
Список pgsql-general
On 2010-02-22, beulah prasanthi wrote:

> Helo
>      I am working on spring project with postgres 8.4
> i wrote a function in postgrees which i am passing the
> argument email email[] array
> From front end we need to insesrt data into that emailarray
> .so i used java.arraylist.util
> while i am running i got the following error Please help me
>
> error:
> org.postgresql.util.PSQLException: Cannot cast an instance of
> java.util.ArrayList to type Types.ARRAY
>

The array support in JDBC is imo nothing better than horrible. However,
the way to go is:
    Connection c = getConnection();
    Array arr = c.createArrayOf("text", email);

    PreparedStatement p = c.prepareStatement(...);
    p.setArray(index, arr);

Also notice, that there is no nice way to test array data in frameworks
like DBUnit and others.


--
Robert...



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

Предыдущее
От: Stefan Schwarzer
Дата:
Сообщение: SELECT only those values of table B which have a value in table A
Следующее
От: Michal Politowski
Дата:
Сообщение: Re: SELECT only those values of table B which have a value in table A