public static User LoginUser(String username, String password)
    {
    try
    {
       String query = String.format("SELECT * FROM APPUSERS WHERE USERNAME = '%s' AND PASSWORD  ='%s'", username, password);
       
       User loginUser = new User();
       ResultSet rs = getQueryResults(query);
       if (rs.next())
       {
           loginUser.userName = rs.getString("UserName");
           loginUser.fullName = rs.getString("FullName");
           loginUser.dbId = rs.getInt("UserId");
           int utype = rs.getInt("usertypeid");
           loginUser.utype = User.UserType.values()[utype-1];
           return loginUser;
       }
       return null;
       
    }
    catch (SQLException ex)
    {
        return null;
    }
    }