Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C7BCA6327D4 for ; Mon, 13 Jul 2009 18:42:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 87369-08 for ; Mon, 13 Jul 2009 18:42:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 14B04632375 for ; Mon, 13 Jul 2009 18:42:08 -0300 (ADT) Received: from 125-237-255-118.jetstream.xtra.co.nz ([125.237.255.118] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MQTHe-0003a6-Lr; Tue, 14 Jul 2009 09:42:02 +1200 Message-ID: <4A5BAA29.9000004@opencloud.com> Date: Tue, 14 Jul 2009 09:42:01 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.22 (X11/20090608) MIME-Version: 1.0 To: Thomas Kellerer CC: pgsql-jdbc@postgresql.org Subject: Re: DELETE ... RETURNING References: <226a19190907131251m6c3786f5id8e8025f5c53cf66@mail.gmail.com> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/27 X-Sequence-Number: 19795 Thomas Kellerer wrote: > At least executeUpdate() should not throw an exception. Wrong, see the javadoc: > Throws: > SQLException - if a database access error occurs or the SQL statement returns a ResultSet object Your SQL statement is returning a ResultSet object, so executeUpdate correctly throws an exception. Use executeQuery() or execute(). -O