Re: Error codes in SQLException

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Christian Rengstl *EXTERN*" <Christian(dot)Rengstl(at)klinik(dot)uni-regensburg(dot)de>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Error codes in SQLException
Date: 2007-10-30 13:38:06
Message-ID: D960CB61B694CF459DCFB4B0128514C27F6E2C@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Christian Rengstl wrote:
> I was just wondering if there is a overview somewhere with the integer
> values returned by SQLException when calling getErrorCode().

getErrorCode() will return a vendor specific code; this is the
third argument in the three-argument constructor of
java.sql.SQLException.

As far as I can see this constructor is never used in PostgreSQL,
so I would say that getErrorCode() will always return 0.

This makes sense since PostgreSQL uses no vendor specific
error codes, but the (supposedly fairly standardized)
SQLSTATEs (see
http://www.postgresql.org/docs/current/static/errcodes-appendix.html)

You can get those with getSQLState().

Yours,
Laurenz Albe

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marek Lewczuk 2007-10-30 13:47:45 Re: AbstractJdbc2Array - another patch
Previous Message Achilleas Mantzios 2007-10-30 12:44:55 Re: Error codes in SQLException