java.lang.Object
com.example.project.services.sqlite.dAOs.UsersDAO

public class UsersDAO extends Object
SQLite Users database. with a table `users` 2 columns. 'username', 'password'. Which are both defined as unique not null Strings in sqlite.
  • Constructor Details

    • UsersDAO

      public UsersDAO()
      Constructor for this class SQLLiteDictionary.
    • UsersDAO

      public UsersDAO(Connection connection, Logger logger)
      Constructor with injection for unit tests.
      Parameters:
      connection - Connection
      logger - logger.
  • Method Details

    • addUser

      public void addUser(User user)
      Adds user to the user.db. password will be hashed before storing to ensure greater security (no plain text passwords)
      Parameters:
      user - user to add.
    • doesUserExist

      public boolean doesUserExist(String username)
      Parameters:
      username - username
      Returns:
      returns bool indicating whether use is in database already.
    • getUser

      public User getUser(String username)
      Parameters:
      username - username.
      Returns:
      returns user with matching username.