ErrorCodes suddenly stopped working? [possibly my programming error] - Mailing list pgsql-jdbc

From Assad Jarrahian
Subject ErrorCodes suddenly stopped working? [possibly my programming error]
Date
Msg-id 4bd3e1480511132058y42f60a2k687c943992755c85@mail.gmail.com
Whole thread Raw
Responses Re: ErrorCodes suddenly stopped working? [possibly my  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Postgres 8.1.4 beta.
I may have modified something, but I dont think I did.

code:

try{
            registerUser.setString(1,client.getName());
            registerUser.setString(2,client.getPassword());
            registerUser.executeUpdate();
        }
        catch(SQLException ex) {
            if (ex.getErrorCode()== 23505)
                throw new ProximityDBException("UserName Already Exists",
ProximityDBException.ERROR_AUTHENTICATION_FAILED);
            else
                System.out.println("ERROR CODE FROM SQLException " + ex.getErrorCode());
                throw new ProximityDBException(ex.getMessage(), ex.getErrorCode());
        }
    }

before it would throw getErrorCode() as 23505 with a duplicate
username. Now all it throws is 0 (for other prepared statements as
well).

I get this from SQLException
ERROR: duplicate key violates unique constraint "table_user" 0

Is there a way to check what went wrong (or what I did wrong)? Your
input is appreciated. Thanks.

-assad

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]
Next
From: Kris Jurka
Date:
Subject: Re: ErrorCodes suddenly stopped working? [possibly my