ErrorCodes suddenly stopped working? [possibly my programming error]

From: Assad Jarrahian <jarraa(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: ErrorCodes suddenly stopped working? [possibly my programming error]
Date: 2005-11-14 04:58:07
Message-ID: 4bd3e1480511132058y42f60a2k687c943992755c85@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-11-14 05:41:11 Re: ErrorCodes suddenly stopped working? [possibly my
Previous Message Dave Cramer 2005-11-14 00:16:32 Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]