From: Dave Cramer <pg@fastcrypt.com>
To: Jojo Paderes <jojo.paderes@gmail.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: implementing setObject(n, java array[])
Date: Sun, 20 Nov 2005 11:10:45 -0500
Message-ID: <6D0E63FD-C292-4244-9F37-EAD8F525A700@fastcrypt.com> (raw)
In-Reply-To: <65f9ddfb0511200801qf0dff97lea9c4ceaa220d2ae@mail.gmail.com>
References: <7957B027-21F3-41C2-B5AF-45E6D7C9F25D@fastcrypt.com>
<65f9ddfb0511200801qf0dff97lea9c4ceaa220d2ae@mail.gmail.com>
Jojo,
The setObject array is not implemented. This is something we should
do. The spec suggests that you implement the java.sql.Array interface
on your object and
use setArray(n,Array)
Enough people have complained that I guess it's time we implemented it.
Patches are welcome!
Dave
On 20-Nov-05, at 11:01 AM, Jojo Paderes wrote:
> I've been looking for a way to pass array values of Java primitive
> types to a PL/pgSQL function that accepts an array parameter. I keep
> on getting this exception:
>
> org.postgresql.util.PSQLException: Can't infer the SQL type to use for
> an instance of [I. Use setObject() with an explicit Types value to
> specify the type to use.
>
> Also, I'm looking for a technical resource from the PGSQL JDBC site on
> how to pass primitive array values to functions using the
> CallableStatement class. Any tips on how to do this?
>
> On 10/18/05, Dave Cramer <pg@fastcrypt.com> wrote:
>> There are a number of people who would like to be able to do
>>
>> Statement.setObject( n, int[] )
>>
>> as well as most other java primitive arrays.
>>
>> The array implementation seems to be quite a stumbling block to non
>> java people . I certainly see the merit in doing this.
>>
>> What do others think ?
>>
>> Dave
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, jojo.paderes@gmail.com
Subject: Re: implementing setObject(n, java array[])
In-Reply-To: <6D0E63FD-C292-4244-9F37-EAD8F525A700@fastcrypt.com>
References: <7957B027-21F3-41C2-B5AF-45E6D7C9F25D@fastcrypt.com> <65f9ddfb0511200801qf0dff97lea9c4ceaa220d2ae@mail.gmail.com> <6D0E63FD-C292-4244-9F37-EAD8F525A700@fastcrypt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox