passing array to database function

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

passing array to database function

От:
"padmanabha konkodi" <konkodi221@rediffmail.com>
Дата:

 hi everybody,

i want to pass Integer array to database function from java precompiled statement.

java gives java.sql.Array interface but i dont know which implementing class i have to use in postgre

regards
ptrashantha.k.p




Re: passing array to database function

От:
Richard Huxton <dev@archonet.com>
Дата:
padmanabha konkodi wrote:
> Â hi everybody,
> 
> i want to pass Integer array to database function from java
> precompiled statement.
> 
> java gives java.sql.Array interface but i dont know which
> implementing class i have to use in postgre

I don't really "do" java, but have you tried an array of integers for 
your PostgreSQL function? What happened?

--   Richard Huxton  Archonet Ltd


Re: passing array to database function

От:
Achilleus Mantzios <achill@matrix.gatewaynet.com>
Дата:
O Richard Huxton έγραψε στις Feb 7, 2006 :

> padmanabha konkodi wrote:
> > Β hi everybody,
> > 
> > i want to pass Integer array to database function from java
> > precompiled statement.
> > 
> > java gives java.sql.Array interface but i dont know which
> > implementing class i have to use in postgre
> 
> I don't really "do" java, but have you tried an array of integers for 
> your PostgreSQL function? What happened?

The correct list is -jdbc.
Theoritically you would have to write your own implementation
of java.sql.Array.
Practically build a String with the contents you want
e.g.
'{1,2,3,4}' 
for a int[] array, and your done.

> 
> 

-- 
-Achilleus


FAQ