pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
CallableStatements: index starts at 2
7+ messages / 4 participants
[nested] [flat]

* CallableStatements: index starts at 2
@ 2005-12-14 10:56  Thomas Frieling <frieling@8hertz.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Thomas Frieling @ 2005-12-14 10:56 UTC (permalink / raw)
  To: pgsql-jdbc

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




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: CallableStatements: index starts at 2
@ 2005-12-14 16:38  Andres Olarte <olarte.andres@gmail.com>
  parent: Thomas Frieling <frieling@8hertz.de>
  0 siblings, 1 reply; 7+ messages in thread

From: Andres Olarte @ 2005-12-14 16:38 UTC (permalink / raw)
  To: Thomas Frieling <frieling@8hertz.de>; 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
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: CallableStatements: index starts at 2
@ 2005-12-14 17:41  Dave Cramer <pg@fastcrypt.com>
  parent: Andres Olarte <olarte.andres@gmail.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Dave Cramer @ 2005-12-14 17:41 UTC (permalink / raw)
  To: Andres Olarte <olarte.andres@gmail.com>; +Cc: Thomas Frieling <frieling@8hertz.de>; pgsql-jdbc

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 <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
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: CallableStatements: index starts at 2
@ 2005-12-15 22:13  Kris Jurka <books@ejurka.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  1 sibling, 2 replies; 7+ messages in thread

From: Kris Jurka @ 2005-12-15 22:13 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Andres Olarte <olarte.andres@gmail.com>; Thomas Frieling <frieling@8hertz.de>; pgsql-jdbc



On Wed, 14 Dec 2005, Dave Cramer wrote:

> 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.

This fix only works on JDK1.4 builds.  It doesn't work on 1.2, 1.3, or 1.5 
because you've only modified Jdbc3CallableStatement.  This also indicates 
the fragility of the adjustIndex parameter.  Unfortunately we can't create 
an AbstractJdbc2CallableStatement because we'd need multiple inheritance 
for Jdbc3CallableStatement to extend both AbstractJdbc3Statement and 
AbstractJdbc[2|3]CallableStatement.

Also your test case using the function getVoid does not work against 7.2 
servers because the void pseudotype was added in 7.3.  The void type 
doesn't seem to be important for testing.  You should be able to call a 
function returing anything and ignore the result.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: CallableStatements: index starts at 2
@ 2005-12-15 22:14  Kris Jurka <books@ejurka.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Kris Jurka @ 2005-12-15 22:14 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Andres Olarte <olarte.andres@gmail.com>; Thomas Frieling <frieling@8hertz.de>; pgsql-jdbc



On Wed, 14 Dec 2005, Dave Cramer wrote:

> 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.
>

Doesn't this also need to be backpatched to 8.1.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: CallableStatements: index starts at 2
@ 2005-12-15 22:19  Dave Cramer <pg@fastcrypt.com>
  parent: Kris Jurka <books@ejurka.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Dave Cramer @ 2005-12-15 22:19 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Andres Olarte <olarte.andres@gmail.com>; Thomas Frieling <frieling@8hertz.de>; pgsql-jdbc

Well, I was waiting for exactly this report before backpatching  
anything.

Dave
On 15-Dec-05, at 5:13 PM, Kris Jurka wrote:

>
>
> On Wed, 14 Dec 2005, Dave Cramer wrote:
>
>> 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.
>
> This fix only works on JDK1.4 builds.  It doesn't work on 1.2, 1.3,  
> or 1.5 because you've only modified Jdbc3CallableStatement.  This  
> also indicates the fragility of the adjustIndex parameter.   
> Unfortunately we can't create an AbstractJdbc2CallableStatement  
> because we'd need multiple inheritance for Jdbc3CallableStatement  
> to extend both AbstractJdbc3Statement and AbstractJdbc[2|3] 
> CallableStatement.
>
> Also your test case using the function getVoid does not work  
> against 7.2 servers because the void pseudotype was added in 7.3.   
> The void type doesn't seem to be important for testing.  You should  
> be able to call a function returing anything and ignore the result.
>
> Kris Jurka
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: CallableStatements: index starts at 2
@ 2006-01-30 20:13  Kris Jurka <books@ejurka.com>
  parent: Kris Jurka <books@ejurka.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Kris Jurka @ 2006-01-30 20:13 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: Andres Olarte <olarte.andres@gmail.com>; Thomas Frieling <frieling@8hertz.de>; pgsql-jdbc



On Thu, 15 Dec 2005, Kris Jurka wrote:

> On Wed, 14 Dec 2005, Dave Cramer wrote:
>
>> 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.
>
> This fix only works on JDK1.4 builds.  It doesn't work on 1.2, 1.3, or 1.5 
> because you've only modified Jdbc3CallableStatement.  This also indicates the 
> fragility of the adjustIndex parameter.  Unfortunately we can't create an 
> AbstractJdbc2CallableStatement because we'd need multiple inheritance for 
> Jdbc3CallableStatement to extend both AbstractJdbc3Statement and 
> AbstractJdbc[2|3]CallableStatement.

Fixed and backpatched to 8.1.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2006-01-30 20:13 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-14 10:56 CallableStatements: index starts at 2 Thomas Frieling <frieling@8hertz.de>
2005-12-14 16:38 ` Andres Olarte <olarte.andres@gmail.com>
2005-12-14 17:41   ` Dave Cramer <pg@fastcrypt.com>
2005-12-15 22:13     ` Kris Jurka <books@ejurka.com>
2005-12-15 22:19       ` Dave Cramer <pg@fastcrypt.com>
2006-01-30 20:13       ` Kris Jurka <books@ejurka.com>
2005-12-15 22:14     ` Kris Jurka <books@ejurka.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox