Search Postgresql Archives

Re: helo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...
 


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux