Обсуждение: helo

Поиск
Список
Период
Сортировка

helo

От
beulah prasanthi
Дата:
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

Re: helo

От
Kris Jurka
Дата:

On Mon, 22 Feb 2010, 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
>

You need to pass an instance of java.sql.Array, not a Collection or
something else that is array like.

Also please only report an issue once rather than a half dozen times.

Kris Jurka

Re: helo

От
"Kevin Grittner"
Дата:
Kris Jurka <books@ejurka.com> wrote:

> You need to pass an instance of java.sql.Array, not a Collection
> or something else that is array like.

Ah, right.  After extracting an array from the java.util.ArrayList,
it needs to be turned into a java.sql.Array using the
Connection.createArrayOf method.

Most definitely not a PostgreSQL bug.

-Kevin