Re: PreparedStatement batch statement impossible

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: hans wulf <lotu1(at)gmx(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PreparedStatement batch statement impossible
Date: 2011-03-07 15:47:43
Message-ID: AANLkTing75530SCuoegWawVmtNaFt8pt=4z90TyEj_1U@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hans,

The API says that executeBatch is to return an array of update counts.
How would one return generated keys ?

Dave

On Wed, Mar 2, 2011 at 9:38 AM, hans wulf <lotu1(at)gmx(dot)net> wrote:
> Hi,
>
> when using addBatch() and executeBatch() it is impossible to get the generated keys. addBatch() fails with an BatchUpdateException because it isn't expecting results. I am using postgres 9.0 and the newest 9.0_801 JDBC-Thingy.
>
> The statement is generated with cn.prepareStatement(sqlStufff,Statement.RETURN_GENERATED_KEYS);
>
> Code works fine with Mysql, so I guess it's a driver problem.
>
> Until this bug is fixed, what is the workaround too use batchupdates on more than one table? Tables beeing linked by generated keys.
>
> Any ideas?
>
> Thanks so much.
>
>
> --
> Schon gehört? GMX hat einen genialen Phishing-Filter in die
> Toolbar eingebaut! http://www.gmx.net/de/go/toolbar
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message hans wulf 2011-03-08 14:17:05 Re: PreparedStatement batch statement impossible
Previous Message hans wulf 2011-03-02 14:38:01 PreparedStatement batch statement impossible