Home > Archive > PostgreSQL JDBC > November 2005 > ErrorCodes suddenly stopped working? [possibly my programming error]









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 ErrorCodes suddenly stopped working? [possibly my programming error]
Assad Jarrahian

2005-11-14, 3:24 am

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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

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