Skip to content

Commit

Permalink
set account_id
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsundin committed Jan 28, 2024
1 parent 3c07153 commit 40be87b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/DAO/AccountDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ public Account findAccountByUsername(String username) {

ResultSet rs = ps.executeQuery();
if (rs.next()) {
int account_id = (int) rs.getLong(1);
String usernameFromDB = rs.getString(2);
String password = rs.getString(3);
return new Account(usernameFromDB, password);
Account account = new Account(usernameFromDB, password);
account.setAccount_id(account_id);
return account;
}
} catch (SQLException e) {
e.printStackTrace();
Expand Down

0 comments on commit 40be87b

Please sign in to comment.