X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0354D11F6932 for ; Tue, 28 Mar 2006 16:56:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13061-09 for ; Tue, 28 Mar 2006 16:56:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id 2A7C711F6937 for ; Tue, 28 Mar 2006 16:56:43 -0400 (AST) Received: (qmail 9725 invoked by uid 1112); 28 Mar 2006 20:56:43 -0000 Date: Tue, 28 Mar 2006 15:56:42 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: jao@geophile.com cc: pgsql-jdbc@postgresql.org Subject: Re: Array support in 8.1 JDBC driver In-Reply-To: <20060328120922.j4j45ztgsgc4go40@geophile.com> Message-ID: References: <20060328120922.j4j45ztgsgc4go40@geophile.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.118 required=5 tests=[AWL=0.118] X-Spam-Score: 0.118 X-Spam-Level: X-Archive-Number: 200603/132 X-Sequence-Number: 14913 On Tue, 28 Mar 2006, jao@geophile.com wrote: > I'm not sure I understand this. It sounds like the array is converted > to a string. Is the string then just pasted into the query? What does > this to to the use of server-side prepared statements? I'd like to > avoid parsing the "same" statement repeatedly due to the use of > arrays. > > Or is the string then somehow used to bind an array to the prepared > statement? Yes. The conversion to string is for the bind parameter. Basically setArray takes a java.sql.Array not something like int[]. We also require a very specific implementation of the java.sql.Array interface to be passed to the setArray function. The requirements are that getBaseType return the correct type value and that calling toString returns the data in the format that the postgresql server expects for a bind variable. Kris Jurka