Re: ErrorCodes suddenly stopped working? [possibly my - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: ErrorCodes suddenly stopped working? [possibly my
Date
Msg-id Pine.BSO.4.61.0511140035260.4900@leary.csoft.net
Whole thread Raw
In response to ErrorCodes suddenly stopped working? [possibly my programming error]  (Assad Jarrahian <jarraa@gmail.com>)
List pgsql-jdbc

On Sun, 13 Nov 2005, Assad Jarrahian wrote:

>         catch(SQLException ex) {
>             if (ex.getErrorCode()== 23505)
>
> before it would throw getErrorCode() as 23505 with a duplicate
> username. Now all it throws is 0 (for other prepared statements as
> well).

Postgresql has never used error codes, these are vendor specific numbers
and I'm guessing you ran this code against some other database.
Postgresql reports SQL State values.  Use SQLException.getSQLState()
instead.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Assad Jarrahian
Date:
Subject: ErrorCodes suddenly stopped working? [possibly my programming error]
Next
From: Bruce Momjian
Date:
Subject: Re: prepareThreshold=1 and statement.executeBatch() ??