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 1D9713A3D19 for ; Thu, 18 Nov 2004 22:18:57 +0000 (GMT) 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 60336-08 for ; Thu, 18 Nov 2004 22:18:46 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id E32A23A3BA6 for ; Thu, 18 Nov 2004 22:18:46 +0000 (GMT) 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 (Exim 3.35 #1 (Debian)) id 1CUubz-0008EU-00; Fri, 19 Nov 2004 11:18:43 +1300 Message-ID: <419D20AD.8090507@opencloud.com> Date: Fri, 19 Nov 2004 11:22:37 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.9 (X11/20041115) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jessica xingzc_he Cc: pgsql-jdbc@postgresql.org Subject: Re: how to create an object of java.sql.Array References: In-Reply-To: X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/140 X-Sequence-Number: 11562 jessica xingzc_he wrote: > support the data type of a column is int[], i can use > ResultSet.updateArray(int, Array) to update it, right? My question is > how to create an instance of java.sql.Array to pass in updateArray? The driver does not really support setArray() / updateArray() for arbitary Array implementations. I had a patch to fix this ages ago but it has rotted since then, and was never really the right way to do it anyway. You can provide your own implementation of Array and it should work so long as: - it implements Array.getBaseTypeName(), returning the underlying element type name ("int" in your case). - it implements Array.toString(), returning an array constant formatted as the postgresql backend expects (e.g. "{1,2,3}"). > BTW, does 7.4.x postgresql jdbc driver support RowSet? As I understand it, RowSet isn't meant to be implemented by drivers, it is a layer that sits on top of the driver. I don't know how well implementations of RowSet work with the current driver. -O