pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
No error code on unique constraint violation
3+ messages / 2 participants
[nested] [flat]

* No error code on unique constraint violation
@ 2004-11-29 14:57  Laurent Duperval <Laurent.Duperval@fleetmind.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurent Duperval @ 2004-11-29 14:57 UTC (permalink / raw)
  To: pgsql-jdbc

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.

I'm running on Windows.

L




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: No error code on unique constraint violation
@ 2004-11-29 15:22  Ian Pilcher <i.pilcher@comcast.net>
  parent: Laurent Duperval <Laurent.Duperval@fleetmind.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ian Pilcher @ 2004-11-29 15:22 UTC (permalink / raw)
  To: pgsql-jdbc

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: No error code on unique constraint violation
@ 2004-11-29 16:05  Laurent Duperval <Laurent.Duperval@fleetmind.com>
  parent: Ian Pilcher <i.pilcher@comcast.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Laurent Duperval @ 2004-11-29 16:05 UTC (permalink / raw)
  To: Ian Pilcher <i.pilcher@comcast.net>; +Cc: pgsql-jdbc

Ian Pilcher wrote:

>
> You need to check the SQLSTATE string -- SQLException.getSQLState().
>

Ah, indeed. Thanks,

L



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-11-29 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-29 14:57 No error code on unique constraint violation Laurent Duperval <Laurent.Duperval@fleetmind.com>
2004-11-29 15:22 ` Ian Pilcher <i.pilcher@comcast.net>
2004-11-29 16:05   ` Laurent Duperval <Laurent.Duperval@fleetmind.com>

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