Re: SQLException.getErrorCode ?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Maxime Lévesque <maxime(dot)levesque(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: SQLException.getErrorCode ?
Date: 2010-05-01 16:20:19
Message-ID: alpine.BSO.2.00.1005011217130.13830@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-05-01 16:56:09 Re: Driver not returning the type for TYPEs
Previous Message Maxime Lévesque 2010-05-01 16:11:21 SQLException.getErrorCode ?