Re: SQLException.getErrorCode ? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: SQLException.getErrorCode ?
Date
Msg-id alpine.BSO.2.00.1005011217130.13830@leary.csoft.net
Whole thread Raw
In response to SQLException.getErrorCode ?  (Maxime Lévesque <maxime.levesque@gmail.com>)
Responses Re: SQLException.getErrorCode ?
List pgsql-jdbc

On Sat, 1 May 2010, Maxime L?vesque wrote:

>  The method  SQLException.getErrorCode of the jdbc driver systematically
> returns 0,
>
>  http://www.postgresql.org/docs/8.4/interactive/errcodes-appendix.html

As I said earlier you need to check SQLException.getSQLState, not
getErrorCode.  As you can see the error conditions listed in the appendix
are not all numeric so they cannot be returned via getErrorCode.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Maxime Lévesque
Date:
Subject: SQLException.getErrorCode ?
Next
From: Kris Jurka
Date:
Subject: Re: Driver not returning the type for TYPEs