pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PGStatement#setUseServerPrepare breaking PreparedStatement#executeUpdate return value?
2+ messages / 2 participants
[nested] [flat]

* PGStatement#setUseServerPrepare breaking PreparedStatement#executeUpdate return value?
@ 2005-02-23 16:24  Guillaume Cottenceau <gc@mnc.ch>
  0 siblings, 1 reply; 2+ messages in thread

From: Guillaume Cottenceau @ 2005-02-23 16:24 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

I use postgres-7.4.5 with postgresql-7.4.5.jar built out of it.

I have noticed that the int result from
PreparedStatement#executeUpdate for a DELETE statement is always
1 for me, even if 0 rows were affected by the statement, breaking
the JDBC API (or at least its documentation).

I have experimented and noticed that removing my call to
PGStatement#setUseServerPrepare(true) workarounds the bug.

Is there any way to workaround it otherwise? Is it a known and/or
normal bug?

Thanks,

-- 
Guillaume Cottenceau



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

* Re: PGStatement#setUseServerPrepare breaking
@ 2005-02-23 19:03  Kris Jurka <books@ejurka.com>
  parent: Guillaume Cottenceau <gc@mnc.ch>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2005-02-23 19:03 UTC (permalink / raw)
  To: Guillaume Cottenceau <gc@mnc.ch>; +Cc: pgsql-jdbc



On Wed, 23 Feb 2005, Guillaume Cottenceau wrote:

> I use postgres-7.4.5 with postgresql-7.4.5.jar built out of it.
> 
> I have noticed that the int result from
> PreparedStatement#executeUpdate for a DELETE statement is always
> 1 for me, even if 0 rows were affected by the statement, breaking
> the JDBC API (or at least its documentation).
> 
> I have experimented and noticed that removing my call to
> PGStatement#setUseServerPrepare(true) workarounds the bug.
> 
> Is there any way to workaround it otherwise? Is it a known and/or
> normal bug?
> 

This is a known bug that requires upgrading to either the 8.0 server which 
returns the correct command completion tag on EXECUTE, or the 8.0 driver 
which uses protocol level prepared statements instead of SQL PREPARE / 
EXECUTE.

Kris Jurka



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


end of thread, other threads:[~2005-02-23 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-23 16:24 PGStatement#setUseServerPrepare breaking PreparedStatement#executeUpdate return value? Guillaume Cottenceau <gc@mnc.ch>
2005-02-23 19:03 ` Re: PGStatement#setUseServerPrepare breaking 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