pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ken Johanson <pg-user@kensystem.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
Date: Thu, 15 Feb 2007 21:30:49 -0700
Message-ID: <45D53379.8070902@kensystem.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0702152224200.29540@leary.csoft.net>
References: <4580E681.3080106@kensystem.com>
	<45B9A9D6.2080100@kensystem.com>
	<Pine.BSO.4.64.0701262352340.20148@leary2.csoft.net>
	<45BECBA1.8080508@kensystem.com>
	<Pine.BSO.4.64.0702011325410.23261@leary2.csoft.net>
	<45D24BF2.6010405@kensystem.com>
	<Pine.BSO.4.64.0702141250550.3571@leary.csoft.net>
	<45D3E22F.9050009@kensystem.com>
	<45D4311A.6050308@gtech-ua.com>
	<45D4EF6A.4000608@kensystem.com>
	<Pine.BSO.4.64.0702152224200.29540@leary.csoft.net>

Kris Jurka wrote:
> 
> The correct version check should be written:
> if (connection.haveMinimumServerVersion("8.2"))
> 

I will correct this.

> I'm also not sure about the getGeneratedKeys method.  Should we throw an 
> Exception instead of returning an empty ResultSet if there weren't any 
> generated keys?

I checked and the spec says:
"If this Statement object did not generate any keys, an empty ResultSet 
  object is returned."
If there is an implied rules elsewhere that it is not this simple, I 
dont know. Otherwise it seems correct.

   Also do we need to do better tracking of what comes
> from generated keys vs just regular results?

I believe you are correct; if that method is called not-after 
executeUpdate(String sql, ?), it should throw and exception.. or 
something... the spec does not seem to elaborate on this.

   Once people start using
> this functionality we'll need some better error checking.

Agreed in full.





view thread (50+ messages)  latest in thread

Message-ID: <45D53379.8070902@kensystem.com>
Permalink:  ../45D53379.8070902@kensystem.com/
Also on:    postgresql.org/message-id/45D53379.8070902@kensystem.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pg-user@kensystem.com, books@ejurka.com
  Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
  In-Reply-To: <45D53379.8070902@kensystem.com>
  References: <4580E681.3080106@kensystem.com> <45B9A9D6.2080100@kensystem.com> <Pine.BSO.4.64.0701262352340.20148@leary2.csoft.net> <45BECBA1.8080508@kensystem.com> <Pine.BSO.4.64.0702011325410.23261@leary2.csoft.net> <45D24BF2.6010405@kensystem.com> <Pine.BSO.4.64.0702141250550.3571@leary.csoft.net> <45D3E22F.9050009@kensystem.com> <45D4311A.6050308@gtech-ua.com> <45D4EF6A.4000608@kensystem.com> <Pine.BSO.4.64.0702152224200.29540@leary.csoft.net> <45D53379.8070902@kensystem.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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