Skip site navigation (1) Skip section navigation (2)

Re: passing user defined data types to stored procedures

From: "Jay Howard" <jhoward(at)alumni(dot)utexas(dot)net>
To: "Kris Jurka" <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: passing user defined data types to stored procedures
Date: 2008-11-16 02:29:40
Message-ID: 7569a8ec0811151829j36f5e4bdy5055f53d37a35558@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Turns out I was returning an array of composites after all.  Everything
works as expected when the array elements are simple types.

That begs the question, though- is supporting arrays of composite types on
the list of "things to do"?

Here's what I get when I call java.sql.Array.getArray() and the array
contains composites:

Method org.postgresql.jdbc4.Jdbc4Array.getArrayImpl(long,int,Map) is not yet
implemented.

On Sat, Nov 15, 2008 at 12:20 PM, Jay Howard <jhoward(at)alumni(dot)utexas(dot)net>wrote:

> Actually it may not have been an array of integers.  I was doing stuff with
> composite types, so that may be the problem.  The message I got from
> getArray() indicated that the "full" version of that method, which it must
> call internally, wasn't implemented.  I'll verify tonight and respond with
> some sample code.
>
>
> On Sat, Nov 15, 2008 at 12:02 PM, Kris Jurka <books(at)ejurka(dot)com> wrote:
>
>>
>>
>> On Sat, 15 Nov 2008, Jay Howard wrote:
>>
>>  Is it possible to return (and pass) arrays using java.sql.Array?
>>>
>>> I wrote a test proc that returns an array of integers.  I can retrieve it
>>> on
>>> the java side as a Jdbc3Array, which implements java.sql.Array.
>>>
>>> Unfortunately, getArray() (and its variants) seem not to have been
>>> implemented yet by Jdbc3Array.
>>>
>>>
>> getArray is implemented and should work.  Perhaps you're getting confused
>> because you're expecting to receive int[] and you're getting Integer[]
>> instead?  It's tough to say what's going wrong without some example code.
>>
>> Kris Jurka
>>
>
>

In response to

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2008-11-16 12:15:41
Subject: Re: Bug report (with solution) on org.postgresql.jdbc2.EscapedFunctions
Previous:From: fschmidtDate: 2008-11-15 22:20:34
Subject: Re: committing an aborted transaction

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group