Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]

Поиск
Список
Период
Сортировка
Искать
От
Assad Jarrahian
Тема
Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]
Дата
Msg-id
4bd3e1480511131556o58dbeae8y7a08dc55927010e0@mail.gmail.com
Ответ на
Список
Дерево обсуждения
passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] Assad Jarrahian <jarraa@gmail.com>
Re: passing array as parameters to PrepareStatement or callable Kris Jurka <books@ejurka.com>
Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] Assad Jarrahian <jarraa@gmail.com>
Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] Dave Cramer <pg@fastcrypt.com>
Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] Jojo Paderes <jojo.paderes@gmail.com>
Re: passing array as parameters to PrepareStatement or callable Oliver Jowett <oliver@opencloud.com>
Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] Jojo Paderes <jojo.paderes@gmail.com>
Hi Kris and all,
  So I did a quick google search and found out all I need in my new
class that implements Array is getBaseType() and toString() [I am not
sure this is true since it is not working! Either that or I am doing
something wrong]

Code below

public class IDArray implements Array{
        protected int[] myArray;

        public IDArray(int[] temp ){
          ....
         }
	public int getBaseType() throws SQLException {
		return Types.INTEGER;
	}
     	public 	String toString(){
		String temp = new String();
		temp+="{";
		for (int i=0;i wrote:
>
>
> On Sat, 12 Nov 2005, Assad Jarrahian wrote:
>
> > Hello all,
> >  my apologies if this question has been asked before. I looked
> > through the archives could not find the relevant info (if I overlooked
> > something, sorry).
> >
> > int[] intarray = new int[1];
> > getAssociatedLMs.setObject(1, intarray, java.sql.Types.ARRAY);
> > //getAssociatedLM's is a callable statement ("{call getLMs(?,?) } ");
> >
> > so I get a compilation error saying
> > org.postgresql.util.PSQLException: Cannot cast an instance of [I to
> > type Types.ARRAY
>
> Currently the driver only supports passing a specific implementation of
> java.sql.Array to setObject (and setArray).  Other people have posted
> helper classes to transform some specific java array types to
> java.sql.Array, but these have not been generalized and added to the
> driver.
>
> Kris Jurka
>
В списке pgsql-jdbc по дате отправления
От: Kris Jurka
Дата:
От: Dave Cramer
Дата:
FAQ