Re: CallableStatements: index starts at 2 - Mailing list pgsql-jdbc

From Andres Olarte
Subject Re: CallableStatements: index starts at 2
Date
Msg-id 3fccaa690512140838o464dd369y4194a05c4f28d553@mail.gmail.com
Whole thread Raw
In response to CallableStatements: index starts at 2  (Thomas Frieling <frieling@8hertz.de>)
Responses Re: CallableStatements: index starts at 2
List pgsql-jdbc
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 <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 = 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

pgsql-jdbc by date:

Previous
From: Thomas Frieling
Date:
Subject: CallableStatements: index starts at 2
Next
From: Dave Cramer
Date:
Subject: Re: CallableStatements: index starts at 2