pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Pilcher <i.pilcher@comcast.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: No error code on unique constraint violation
Date: Mon, 29 Nov 2004 09:22:01 -0600
Message-ID: <cofeqp$ptd$1@sea.gmane.org> (raw)
In-Reply-To: <41AB38F5.7000205@fleetmind.com>
References: <41AB38F5.7000205@fleetmind.com>

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
========================================================================




view thread (3+ messages)  latest in thread

Message-ID: <cofeqp$ptd$1@sea.gmane.org>
Permalink:  ../cofeqp$ptd$1@sea.gmane.org/
Also on:    postgresql.org/message-id/cofeqp$ptd$1@sea.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: i.pilcher@comcast.net
  Subject: Re: No error code on unique constraint violation
  In-Reply-To: <cofeqp$ptd$1@sea.gmane.org>
  References: <41AB38F5.7000205@fleetmind.com> <cofeqp$ptd$1@sea.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox