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 BC42F9DD6F5 for ; Fri, 2 Dec 2005 09:20:15 -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 90894-08 for ; Fri, 2 Dec 2005 09:20:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 95F559DD647 for ; Fri, 2 Dec 2005 09:20:12 -0400 (AST) Received: (qmail 28072 invoked from network); 2 Dec 2005 13:20:15 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 2 Dec 2005 13:20:15 -0000 In-Reply-To: <200512021142.38982.nosyman@gmail.com> References: <200512021142.38982.nosyman@gmail.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: jdbc and ARRAYs Date: Fri, 2 Dec 2005 08:20:14 -0500 To: NosyMan X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/9 X-Sequence-Number: 14340 You have to implement the java.sql.Array interface and pass that in. search the list, there's a few references to this question and some code. Dave On 2-Dec-05, at 4:42 AM, NosyMan wrote: > Hi everyone, > > I have some problems trying to use a preparedStatement with an array > parameter. The problem is I don't know how to do it :-( > > CREATE OR REPLACE FUNCTION MyFunction( id INTEGER, anArray > VARCHAR[] ).......................... > > > pstat = conn.prepareStatement("SELECT * FROM MyFunction(?,?)"); > pstat.setInt(1, 30); > pstat.setArray(2, ??????????); > > Can you tell me how can I construct the array for parameter number 2? > > Thanks, > NosyMan > > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: explain analyze is your friend >