X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4D6CF329C70 for ; Sat, 11 Sep 2004 03:33:52 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90450-04 for ; Sat, 11 Sep 2004 02:33:43 +0000 (GMT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id AE673329C6B for ; Sat, 11 Sep 2004 03:33:45 +0100 (BST) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1C5xhx-0005lN-00 for ; Sat, 11 Sep 2004 04:33:45 +0200 Received: from c-24-0-240-136.client.comcast.net ([24.0.240.136]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 Sep 2004 04:33:45 +0200 Received: from i.pilcher by c-24-0-240-136.client.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 11 Sep 2004 04:33:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Ian Pilcher Subject: Re: Foreign key constraint & getErrorCode Date: Fri, 10 Sep 2004 21:33:41 -0500 Lines: 15 Message-ID: References: <41422E22.1010104@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-0-240-136.client.comcast.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en In-Reply-To: <41422E22.1010104@opencloud.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/32 X-Sequence-Number: 10922 Oliver Jowett wrote: > Try SQLException.getSQLState() instead. The backend returns (somewhat > standardized) alphanumeric SQL states with errors and the driver exposes > these as via getSQLState(). getErrorCode() is numeric, vendor-specific, > and unused by the current driver. Works like a charm. Thanks! (I didn't realize that the PostgreSQL error codes were alphanumeric; makes it kind of hard to pack into an integer.) -- ======================================================================== Ian Pilcher i.pilcher@comcast.net ========================================================================