public Group getGroup(int Id) {
        Connection connection = ConnectionManager.getConnection();
        if (connection == null) {
            logger.log(Level.SEVERE, "Couln't establish a connection to database");
            return null;
        }        
        try {
            PreparedStatement ps = connection.prepareStatement(SELECT_BY_ID_QUERY);
            ps.setInt(1, Id);
            ResultSet rs = ps.executeQuery();
            if (rs.next()) {
                return new Group(rs.getInt(ID_COLUMN_NAME), rs.getString(NAME_COLUMN_NAME), rs.getInt(PARENT_ID_COLUMN_NAME));
            }
            else {
                return null;
            }
        } catch (SQLException ex) {
            logger.log(Level.SEVERE, null, ex);
            return null;
        }
    }