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