Re: ErrorCodes suddenly stopped working? [possibly my

From: Kris Jurka <books(at)ejurka(dot)com>
To: Assad Jarrahian <jarraa(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ErrorCodes suddenly stopped working? [possibly my
Date: 2005-11-14 05:41:11
Message-ID: Pine.BSO.4.61.0511140035260.4900@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2005-11-16 00:47:34 Re: prepareThreshold=1 and statement.executeBatch() ??
Previous Message Assad Jarrahian 2005-11-14 04:58:07 ErrorCodes suddenly stopped working? [possibly my programming error]