Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 947241337BA4 for ; Wed, 2 Mar 2011 10:44:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 23667-01 for ; Wed, 2 Mar 2011 14:44:46 +0000 (UTC) X-Greylist: delayed 00:06:39.607106 by SQLgrey-1.7.6 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mail.postgresql.org (Postfix) with SMTP id 95A651337B9D for ; Wed, 2 Mar 2011 10:44:45 -0400 (AST) Received: (qmail 11300 invoked by uid 0); 2 Mar 2011 14:38:04 -0000 Received: from 217.91.105.163 by www059.gmx.net with HTTP; Wed, 02 Mar 2011 15:38:01 +0100 (CET) Content-Type: text/plain; charset="utf-8" Date: Wed, 02 Mar 2011 15:38:01 +0100 From: "hans wulf" Message-ID: <20110302143801.135430@gmx.net> MIME-Version: 1.0 Subject: PreparedStatement batch statement impossible To: pgsql-jdbc@postgresql.org X-Authenticated: #18544190 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18J37g7fMUJD3YGZ6tHUgHCsFeaJx3t10XNCMjLUk Ed+/4KV5fotGZH5oPyHdyv3nV8iOCCwVD9gw== Content-Transfer-Encoding: 8bit X-GMX-UID: LT8LDIlAfW47VwSsbWRoTaNudmllcoXo X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.346 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201103/2 X-Sequence-Number: 21557 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