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 15E569DC82E for ; Wed, 14 Dec 2005 12:38:34 -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 20254-02 for ; Wed, 14 Dec 2005 12:38:29 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.195]) by postgresql.org (Postfix) with ESMTP id 23DF89DC81E for ; Wed, 14 Dec 2005 12:38:27 -0400 (AST) Received: by wproxy.gmail.com with SMTP id 69so411162wri for ; Wed, 14 Dec 2005 08:38:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=RqLVn11K6gdj0vvGThEuvJIkGBfprgy/9+fJmlrvwHib2P8IF50q3EIg+5EbgZXgVPjJF/4bDU33kgRtp5dq19CbMuELeHaHgBy2OF0YSe4+rxlSLIAXMY5OxXGrgyia2TfztEn0ugIwMqafCZzJmmC+tEhG3nfZGwrhGXYJm4c= Received: by 10.54.150.12 with SMTP id x12mr872728wrd; Wed, 14 Dec 2005 08:38:27 -0800 (PST) Received: by 10.54.94.1 with HTTP; Wed, 14 Dec 2005 08:38:24 -0800 (PST) Message-ID: <3fccaa690512140838o464dd369y4194a05c4f28d553@mail.gmail.com> Date: Wed, 14 Dec 2005 10:38:24 -0600 From: Andres Olarte To: Thomas Frieling , pgsql-jdbc@postgresql.org Subject: Re: CallableStatements: index starts at 2 In-Reply-To: <439FFA76.1070706@8hertz.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11227_19235932.1134578304636" References: <439FFA76.1070706@8hertz.de> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200512/58 X-Sequence-Number: 14389 ------=_Part_11227_19235932.1134578304636 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 =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 > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > ------=_Part_11227_19235932.1134578304636 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline You probably should use prepareStatement instead of prepareCall. = I had the same problem.  You can search the archives to look for a be= tter explanation which I don't remmember right now

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

This _did_ work:
Cal= lableStatement cS =3D con.prepareCall("{ call test(?)}";
cS.se= tString( 1, "abc" );

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

Thanks,
Thomas


---------------------------(en= d of broadcast)---------------------------
TIP 1: if posting/reading thr= ough Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that y= our
      message can get through to the m= ailing list cleanly

------=_Part_11227_19235932.1134578304636--