X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 739FC9FB1E3 for ; Mon, 15 May 2006 01:32:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 08433-03 for ; Mon, 15 May 2006 01:32:50 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54207.mail.yahoo.com (web54207.mail.yahoo.com [206.190.39.249]) by postgresql.org (Postfix) with SMTP id 01BFA9FB2B9 for ; Mon, 15 May 2006 01:25:24 -0300 (ADT) Received: (qmail 88376 invoked by uid 60001); 15 May 2006 04:25:23 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=UnPWxgxRekqQVoN+YWDq+F7FMLXJ3TRINlhXaKZTiKEaeTa7WZwFjTwXnAdvLqKT6ifui2xNuNw73OasSAkE4WAISwdDdQRqSa5tKepjTTL4mDRuQ98znB+tTw6Qwtfjy3Tl73M02sCvezdQTGbtH/wLJC+FeK8AZhQwmdJsQmg= ; Message-ID: <20060515042523.88374.qmail@web54207.mail.yahoo.com> Received: from [64.81.86.61] by web54207.mail.yahoo.com via HTTP; Sun, 14 May 2006 21:25:23 PDT Date: Sun, 14 May 2006 21:25:23 -0700 (PDT) From: "J." Subject: Re: arrays as parameters in callableStatements To: Kris Jurka Cc: pgsql-jdbc@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1983162060-1147667123=:82370" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/44 X-Sequence-Number: 15172 --0-1983162060-1147667123=:82370 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thanks, I thought that might be an issue, but looking at the API, I don't see how to convert an array or ArrayList to an Array object or back. Any tips on where to look? Kris Jurka wrote: On Sun, 14 May 2006, J. wrote: > I've got a PL/pgSQL stored function in my database and I'm trying to > figure out how to call it from my admin script. Some of the parameters > are ArrayList objects of strings and it returns an array that I want to > read to determine what the function actually did. Here is the function > header(?): > > String[] results = stmt.getArray(1); > > I'm getting a compiler error "Incompatible Types" on the second to last > line. getArray returns a java.sql.Array, not a String[]. Also the JDBC driver does not know how to interpret array parameters that are not sent in via setArray or setObject with a java.sql.Array. Kris Jurka ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend --------------------------------- Get amazing travel prices for air and hotel in one click on Yahoo! FareChase --0-1983162060-1147667123=:82370 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thanks, I thought that might be an issue, but looking at the API, I don't see how to convert an array or ArrayList to an Array object or back.  Any tips on where to look?

Kris Jurka <books@ejurka.com> wrote:


On Sun, 14 May 2006, J. wrote:

> I've got a PL/pgSQL stored function in my database and I'm trying to
> figure out how to call it from my admin script. Some of the parameters
> are ArrayList objects of strings and it returns an array that I want to
> read to determine what the function actually did. Here is the function
> header(?):
>
> String[] results = stmt.getArray(1);
>
> I'm getting a compiler error "Incompatible Types" on the second to last
> line.

getArray returns a java.sql.Array, not a String[]. Also the JDBC driver
does not know how to interpret array parameters that are not sent in via
setArray or setObject with a java.sql.Array.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Get amazing travel prices for air and hotel in one click on Yahoo! FareChase --0-1983162060-1147667123=:82370--