pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Assad Jarrahian <jarraa@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: ErrorCodes suddenly stopped working? [possibly my
Date: Mon, 14 Nov 2005 00:41:11 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0511140035260.4900@leary.csoft.net> (raw)
In-Reply-To: <4bd3e1480511132058y42f60a2k687c943992755c85@mail.gmail.com>
References: <4bd3e1480511132058y42f60a2k687c943992755c85@mail.gmail.com>



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




view thread (2+ messages)

Message-ID: <Pine.BSO.4.61.0511140035260.4900@leary.csoft.net>
Permalink:  ../Pine.BSO.4.61.0511140035260.4900@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.61.0511140035260.4900@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, jarraa@gmail.com
  Subject: Re: ErrorCodes suddenly stopped working? [possibly my
  In-Reply-To: <Pine.BSO.4.61.0511140035260.4900@leary.csoft.net>
  References: <4bd3e1480511132058y42f60a2k687c943992755c85@mail.gmail.com> <Pine.BSO.4.61.0511140035260.4900@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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