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