pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedimplementing setObject(n, java array[])
3+ messages / 2 participants
[nested] [flat]
* implementing setObject(n, java array[])
@ 2005-10-18 15:31 Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 3+ messages in thread
From: Dave Cramer @ 2005-10-18 15:31 UTC (permalink / raw)
To: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: implementing setObject(n, java array[])
@ 2005-11-20 16:01 Jojo Paderes <jojo.paderes@gmail.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jojo Paderes @ 2005-11-20 16:01 UTC (permalink / raw)
To: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: implementing setObject(n, java array[])
@ 2005-11-20 16:10 Dave Cramer <pg@fastcrypt.com>
parent: Jojo Paderes <jojo.paderes@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Dave Cramer @ 2005-11-20 16:10 UTC (permalink / raw)
To: Jojo Paderes <jojo.paderes@gmail.com>; +Cc: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-11-20 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-18 15:31 implementing setObject(n, java array[]) Dave Cramer <pg@fastcrypt.com>
2005-11-20 16:01 ` Jojo Paderes <jojo.paderes@gmail.com>
2005-11-20 16:10 ` Dave Cramer <pg@fastcrypt.com>
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