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 F21AB3A5185 for ; Mon, 29 Nov 2004 15:22:22 +0000 (GMT) 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 69608-02 for ; Mon, 29 Nov 2004 15:22:10 +0000 (GMT) Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id D21E73A5166 for ; Mon, 29 Nov 2004 15:22:12 +0000 (GMT) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CYnLw-00060Q-00 for ; Mon, 29 Nov 2004 16:22:12 +0100 Received: from c-24-0-215-208.client.comcast.net ([24.0.215.208]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Nov 2004 16:22:12 +0100 Received: from i.pilcher by c-24-0-215-208.client.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Nov 2004 16:22:12 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Ian Pilcher Subject: Re: No error code on unique constraint violation Date: Mon, 29 Nov 2004 09:22:01 -0600 Lines: 17 Message-ID: References: <41AB38F5.7000205@fleetmind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c-24-0-215-208.client.comcast.net User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) X-Accept-Language: en-us, en In-Reply-To: <41AB38F5.7000205@fleetmind.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: 200411/222 X-Sequence-Number: 11644 Laurent Duperval wrote: > Hello, > > I'm using postgres-jdbc-80b1.308 (type 3) with Postgres 8 beta 5. I'm > running some unit tests where I test unique constraint violations. When > I get an exception, I check the error code to see what it is and take > appropriate action. With SQL Server and Firebird I get a specific error > code but with the Postgres driver I get 0. I'm not sure if this is a > driver or a Postgres problem. > You need to check the SQLSTATE string -- SQLException.getSQLState(). -- ======================================================================== Ian Pilcher i.pilcher@comcast.net ========================================================================