2425262728293031323334
statement.setInt(1, userID); ResultSet result = statement.executeQuery(); if (result.next()) { user = getUserFromResult(result); } else { throw new UserNotFoundException(); } } catch (SQLException e) { throw new DAOException(); } return user;
4445464748495051525354
statement.setString(1, userName); ResultSet result = statement.executeQuery(); if (result.next()) { user = getUserFromResult(result); } else { throw new UserNotFoundException(); } } catch (SQLException e) { throw new DAOException(); } return user;
136137138139140141142143144145146
return false; } else { return true; } } else { throw new UserNotFoundException(); } } catch (SQLException e) { throw new DAOException(); } }