From: | "Wappler, Robert" <rwappler(at)ophardt(dot)com> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: helo |
Date: | 2010-02-25 08:47:20 |
Message-ID: | C8E2DAF0E663A948840B04023E0DE32A0260B5E6@w2k3server02.de.ophardt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs 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...
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Serov | 2010-02-25 09:40:47 | Re: BUG #5314: Error in nested composite types in plpgsql. |
Previous Message | Kovács Zoltán | 2010-02-25 07:30:19 | Re: BUG #5345: non-administrator users cannot create databases with special encoding |
From | Date | Subject | |
---|---|---|---|
Next Message | Michal Politowski | 2010-02-25 08:48:16 | Re: SELECT only those values of table B which have a value in table A |
Previous Message | Stefan Schwarzer | 2010-02-25 08:34:19 | SELECT only those values of table B which have a value in table A |