pstmt.setInt(1, id);
}
ResultSet rs = pstmt.executeQuery();
if (!rs.next()) {
throw new UserNotFoundException("Failed to read user " + id + " from database.");
}
this.id = rs.getInt("userID");
this.username = rs.getString("username");
this.passwordHash = rs.getString("passwordHash");
this.name = rs.getString("name");
this.nameVisible = (rs.getInt("nameVisible") == 1);
this.email = rs.getString("email");
this.emailVisible = (rs.getInt("emailVisible") == 1);
} catch (SQLException sqle) {
throw new UserNotFoundException("Failed to read user " + id + " from database.", sqle);
} finally {
try {
pstmt.close();
} catch (Exception e) {
log.error("" , e);