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 7D9849DC9D4 for ; Wed, 14 Dec 2005 13:42:06 -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 36384-03 for ; Wed, 14 Dec 2005 13:42:05 -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 EB6CF9DC9D2 for ; Wed, 14 Dec 2005 13:42:03 -0400 (AST) Received: (qmail 14576 invoked from network); 14 Dec 2005 17:41:59 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 14 Dec 2005 17:41:59 -0000 In-Reply-To: <3fccaa690512140838o464dd369y4194a05c4f28d553@mail.gmail.com> References: <439FFA76.1070706@8hertz.de> <3fccaa690512140838o464dd369y4194a05c4f28d553@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: multipart/alternative; boundary=Apple-Mail-19--491388207 Message-Id: Cc: Thomas Frieling , pgsql-jdbc@postgresql.org From: Dave Cramer Subject: Re: CallableStatements: index starts at 2 Date: Wed, 14 Dec 2005 12:41:58 -0500 To: Andres Olarte X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.043 required=5 tests=[AWL=0.042, HTML_MESSAGE=0.001] X-Spam-Score: 0.043 X-Spam-Level: X-Archive-Number: 200512/59 X-Sequence-Number: 14390 --Apple-Mail-19--491388207 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed I just checked in a fix for this. It hasn't been well tested on all the various servers so please report problems back to me. dave On 14-Dec-05, at 11:38 AM, Andres Olarte wrote: > You probably should use prepareStatement instead of prepareCall. I > had the same problem. You can search the archives to look for a > better explanation which I don't remmember right now > > On 12/14/05, Thomas Frieling wrote: > It seems that in Version "8.2dev-500 JDBC 3" CallableStatements are > implemented differently from older Versions. > The index to set fields now starts at 2. > > This _did_ work: > CallableStatement cS = con.prepareCall("{ call test(?)}"; > cS.setString( 1, "abc" ); > > This _now_ works: > CallableStatement cS = con.prepareCall("{ call test(?)}"; > cS.setString( 2, "abc" ); > > Thanks, > Thomas > > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that > your > message can get through to the mailing list cleanly > --Apple-Mail-19--491388207 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 I just checked in a fix for = this. It hasn't been well tested on all the various servers so please = report problems back to me.

dave
On = 14-Dec-05, at 11:38 AM, Andres Olarte wrote:

You = probably=A0should use prepareStatement instead of prepareCall.=A0 I had = the same problem.=A0 You can search the archives to look for a better = explanation which I don't remmember right now

On 12/14/05, Thomas = Frieling <frieling@8hertz.de> = wrote:
It seems = that in Version "8.2dev-500 JDBC 3" CallableStatements = are
implemented differently from older Versions.
The index to set = fields now starts at 2.

This _did_ work:
CallableStatement cS = =3D con.prepareCall("{ call test(?)}";
cS.setString( 1, "abc" = );

This _now_ works:
CallableStatement cS =3D = con.prepareCall("{ call test(?)}";
cS.setString( 2, "abc" = );

Thanks,
Thomas


---------------------------(end = of broadcast)---------------------------
TIP 1: if posting/reading = through Usenet, please send an appropriate
=A0=A0=A0=A0=A0=A0subscribe= -nomail command to majordomo@postgresql.org so = that your
=A0=A0=A0=A0=A0=A0message can get through to the mailing = list = cleanly


= --Apple-Mail-19--491388207--