Re: Synthesize support for Statement.getGeneratedKeys()?

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Synthesize support for Statement.getGeneratedKeys()?
Date: 2007-02-13 23:38:26
Message-ID: 45D24BF2.6010405@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote:
>
>
> On Mon, 29 Jan 2007, Ken Johanson wrote:
>
>> Hi Kris, were you able to look at this? If time wont permit that I'll
>> dig back in; though I'd prefer not to duplicate any work your're
>> doing, of course.
>
> Taking another look the obvious problem is that you haven't touched
> AbstractJdbc3Statement.getGeneratedKeys. It still reads:
>
> public ResultSet getGeneratedKeys() throws SQLException
> {
> return createDriverResultSet(new Field[0], new Vector());
> }
>
> So an empty ResultSet is not surprising.
>
> Kris Jurka

Kris, sorry my response is late. Sometimes I get distracted by life :-)

Thanks for pointing that out. I missed the obvious. The following
replacement for that methods works; I can get the generated keys (in
conjunction with my previous patches).

I have not tested this exhaustively, nor given though about the
correctness of the null-normalization below; is this enough for you or
someone to commit the changes?

Thanks,
Ken

public ResultSet getGeneratedKeys() throws SQLException
{
return result==null ?
createDriverResultSet(new Field[0], new Vector())
: result.getResultSet();
}

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2007-02-14 06:11:22 Re: Connection state after network failure?
Previous Message Dave Cramer 2007-02-13 12:24:53 Re: Problem with loginTimeout