X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 936D0D7AC5 for ; Sun, 20 Nov 2005 12:10:51 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97551-02 for ; Sun, 20 Nov 2005 16:10:49 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 96E34D7984 for ; Sun, 20 Nov 2005 12:10:48 -0400 (AST) Received: (qmail 31478 invoked from network); 20 Nov 2005 16:10:47 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 20 Nov 2005 16:10:47 -0000 In-Reply-To: <65f9ddfb0511200801qf0dff97lea9c4ceaa220d2ae@mail.gmail.com> References: <7957B027-21F3-41C2-B5AF-45E6D7C9F25D@fastcrypt.com> <65f9ddfb0511200801qf0dff97lea9c4ceaa220d2ae@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6D0E63FD-C292-4244-9F37-EAD8F525A700@fastcrypt.com> Cc: List Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: implementing setObject(n, java array[]) Date: Sun, 20 Nov 2005 11:10:45 -0500 To: Jojo Paderes X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.016 required=5 tests=[AWL=0.016] X-Spam-Score: 0.016 X-Spam-Level: X-Archive-Number: 200511/125 X-Sequence-Number: 14223 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 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