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

Re: implementing setObject(n, java array[])

From: Jojo Paderes <jojo(dot)paderes(at)gmail(dot)com>
To: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: implementing setObject(n, java array[])
Date: 2005-11-20 16:01:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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(at)fastcrypt(dot)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

In response to


pgsql-jdbc by date

Next:From: Jojo PaderesDate: 2005-11-20 16:03:39
Subject: Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]
Previous:From: Andres OlarteDate: 2005-11-20 00:52:53
Subject: Re: Deadlock problem

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