X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6B47952BAF for ; Mon, 18 Jul 2005 20:09:47 -0300 (ADT) 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 14833-07 for ; Mon, 18 Jul 2005 23:09:38 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 9971452B9E for ; Mon, 18 Jul 2005 20:09:37 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Duejw-0006Te-EJ; Tue, 19 Jul 2005 11:09:36 +1200 Message-ID: <42DC36AF.6060601@opencloud.com> Date: Tue, 19 Jul 2005 11:09:35 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roberta Campo Cc: pgsql-jdbc@postgresql.org Subject: Re: PreparedStatement.setXXX References: In-Reply-To: X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/114 X-Sequence-Number: 13262 Roberta Campo wrote: > A. Using the setArray method : > This requires the implementation of the interface java.sql.Array : > - which methods are required in this case ? > - is there any available implementation of this class ? :) Someone else replied to this with an implementation.. The driver's Array support is pretty bad currently. It will only work if the Array implementation implements: - getBaseTypeName() returns the underlying postgresql type name ("int") - toString() returns a correctly-formatted array string ("{1,2,3}") Proper support for arbitrary Array implementations (and bare arrays via setObject) has been on my todo list for ages but it's no longer a high priority for our application so I doubt I'll work on it any time soon :/ > B. Using the setObject(colnumber, String, type ) method : > This should require less implementation than the Array, shouldn't it ? > - how to specify the type int[] ? JDBC has no mechanism to specify a particular array type via a Types.* constant unfortunately :( > C. Using different drivers / protocol versions / ... Using protocol version 2 as Dave Cramer suggests is a short-term fix but you don't want to be using that in the longer term.. -O