@Override
    public List<User> getUsersByGroupId(int givenGroupId, Boolean includeDisabled) {
        Connection conn = null;
        Statement stn = null;
        ResultSet res = null;
        try {
            List<User> rList = new ArrayList<User>();
            conn = Utils.getConnection();
            stn = conn.createStatement();
            if (includeDisabled) {
                res = stn.executeQuery("SELECT User.* FROM User JOIN UserGroupsRel WHERE User.id=user_id AND group_id=1;");
            } else {
                res = stn.executeQuery("SELECT User.* FROM User JOIN UserGroupsRel WHERE User.id=user_id AND group_id=1 AND UserGroupsRel.is_enabled=TRUE;");
            }
            while(res.next()) {
                User currUser = new User();
                currUser.setId(res.getInt("id"));
                currUser.setLogin(res.getString("login"));
                currUser.setDescription(res.getString("description"));
                currUser.setPassw(res.getString("passw"));
                currUser.setCrtDate(res.getDate("crt_date"));
                currUser.setLogDate(res.getDate("log_date"));
                currUser.setIsAdmin(res.getBoolean("is_admin"));
                currUser.setIsEnabled(res.getBoolean("is_enabled"));
                currUser.setIsActive(res.getBoolean("is_active"));
                rList.add(currUser);
            }
            return rList;
        } catch (NamingException ex) {
            ex.printStackTrace();
            return null;
        } catch (SQLException ex) {
            ex.printStackTrace();
            return null;
        } finally {
            try {
                if (res != null) {
                    res.close();
                }
                if (stn != null) {
                    stn.close();
                }
                if (conn != null) {
                    conn.close();
                }
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
        }
    }