Re: No error code on unique constraint violation

Поиск
Список
Период
Сортировка
От Ian Pilcher
Тема Re: No error code on unique constraint violation
Дата
Msg-id cofeqp$ptd$1@sea.gmane.org
обсуждение исходный текст
Ответ на No error code on unique constraint violation  (Laurent Duperval <Laurent.Duperval@fleetmind.com>)
Ответы Re: No error code on unique constraint violation
Список 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
========================================================================

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Laurent Duperval
Дата:
Сообщение: No error code on unique constraint violation
Следующее
От: Laurent Duperval
Дата:
Сообщение: Re: No error code on unique constraint violation