pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Error codes in SQLException
3+ messages / 3 participants
[nested] [flat]

* Error codes in SQLException
@ 2007-10-30 10:06  Christian Rengstl <Christian.Rengstl@klinik.uni-regensburg.de>
  0 siblings, 2 replies; 3+ messages in thread

From: Christian Rengstl @ 2007-10-30 10:06 UTC (permalink / raw)
  To: pgsql-jdbc

Hi list,

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

Thanks!



Christian Rengstl M.A.
Klinik und Poliklinik für Innere Medizin II
Kardiologie - Forschung
Universitätsklinikum Regensburg
B3 1.388
Franz-Josef-Strauss-Allee 11
93053 Regensburg
Tel.: +49-941-944-7230






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Error codes in SQLException
@ 2007-10-30 12:44  Achilleas Mantzios <achill@matrix.gatewaynet.com>
  parent: Christian Rengstl <Christian.Rengstl@klinik.uni-regensburg.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Achilleas Mantzios @ 2007-10-30 12:44 UTC (permalink / raw)
  To: pgsql-jdbc; +Cc: Christian Rengstl <Christian.Rengstl@klinik.uni-regensburg.de>

Στις Τρίτη 30 Οκτώβριος 2007 12:06, ο/η Christian Rengstl έγραψε:
> Hi list,
>
> I was just wondering if there is a overview somewhere with the integer
> values returned by SQLException when calling getErrorCode().

Browsing at the sources of 7.4.12 (dont shout please!! i know we must upgrade 
in the future), i dont see any reference to getErrorCode() in PSQLException.

The right way however is to use the standardized getSQLState() according to
http://www.postgresql.org/docs/7.4/interactive/errcodes-appendix.html


> Thanks!
>
>
>
> Christian Rengstl M.A.
> Klinik und Poliklinik für Innere Medizin II
> Kardiologie - Forschung
> Universitätsklinikum Regensburg
> B3 1.388
> Franz-Josef-Strauss-Allee 11
> 93053 Regensburg
> Tel.: +49-941-944-7230
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

-- 
Achilleas Mantzios



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Error codes in SQLException
@ 2007-10-30 13:38  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Christian Rengstl <Christian.Rengstl@klinik.uni-regensburg.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Albe Laurenz @ 2007-10-30 13:38 UTC (permalink / raw)
  To: Christian Rengstl *EXTERN* <Christian.Rengstl@klinik.uni-regensburg.de>; 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


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-10-30 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-30 10:06 Error codes in SQLException Christian Rengstl <Christian.Rengstl@klinik.uni-regensburg.de>
2007-10-30 12:44 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
2007-10-30 13:38 ` Albe Laurenz <laurenz.albe@wien.gv.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox