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 32AABDADFC for ; Sat, 12 Nov 2005 13:21:34 -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 05062-05 for ; Sat, 12 Nov 2005 17:21:32 +0000 (GMT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by svr1.postgresql.org (Postfix) with ESMTP id D7E79DAC47 for ; Sat, 12 Nov 2005 13:21:32 -0400 (AST) Received: by wproxy.gmail.com with SMTP id i12so333668wra for ; Sat, 12 Nov 2005 09:21:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Nm1R2lcTXaThROU+J2RK3k8IL4aT9DRk4i1WoNJ2dRUgD9orNF9aECkU2cZDKt29HqQ1Ec4CfJ9TWsclzSQfmD9CPnu5LiSIjQMwPqyM/RByhmN6QU6jdtgWMh7gk7x/VUK3EAh+OFNQ4UJF9SCkrdxVABIzZOOmgRZj1L5FU0k= Received: by 10.65.236.2 with SMTP id n2mr3738295qbr; Sat, 12 Nov 2005 09:21:32 -0800 (PST) Received: by 10.65.95.6 with HTTP; Sat, 12 Nov 2005 09:21:32 -0800 (PST) Message-ID: <4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.com> Date: Sat, 12 Nov 2005 10:21:32 -0700 From: Assad Jarrahian To: pgsql-jdbc@postgresql.org Subject: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.316 required=5 tests=[AWL=0.316] X-Spam-Score: 0.316 X-Spam-Level: X-Archive-Number: 200511/95 X-Sequence-Number: 14193 Hello all, my apologies if this question has been asked before. I looked through the archives could not find the relevant info (if I overlooked something, sorry). int[] intarray =3D new int[1]; getAssociatedLMs.setObject(1, intarray, java.sql.Types.ARRAY); //getAssociatedLM's is a callable statement ("{call getLMs(?,?) } "); so I get a compilation error saying org.postgresql.util.PSQLException: Cannot cast an instance of [I to type Types.ARRAY =09at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2St= atement.java:1637) =09at org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3St= atement.java:1435) =09at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2St= atement.java:1652) =09at //the setObjectLineAbove IF I change it to type Integer[] org.postgresql.util.PSQLException: Cannot cast an instance of [Ljava.lang.Integer; to type Types.ARRAY =09at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2St= atement.java:1637) ...... I notice Dave Cramer mentioned something about this could be an easier process. But what is the process now? (aka, am I completely off?) Much thanks in advance. Assad