Home > Archive > PostgreSQL JDBC > November 2005 > Re: ErrorCodes suddenly stopped working? [possibly my









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: ErrorCodes suddenly stopped working? [possibly my
Kris Jurka

2005-11-14, 3:24 am



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


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com