public Item getItem(int id) throws SQLException {
        PreparedStatement pStatement = connection.prepareStatement("select "
                + "items.id as item_id,"
                + "items.media_type,"
                + "items.format,"
                + "items.title as item_title,"
                + "items.cover,"
                + "items.release_date,"
                + "labels.id as label_id,"
                + "labels.title as label_title,"
                + "labels.country "
                + "from items join labels on "
                + "items.label_id=labels.id where items.id=?");
        pStatement.setInt(1, id);
        ResultSet result = pStatement.executeQuery();
        if (result.next()) {
            Item i = new Item(result.getInt(1), result.getString("media_type"),
                    result.getString("format"),
                    result.getString("item_title"),
                    result.getDate("release_date"));
            if (result.getString("cover") != null) {
                i.setCover(result.getString("cover"));
            }
            if (result.getInt("label_id") != 0) {
                Label l = new Label(result.getInt("label_id"),
                        result.getString("label_title"));
                if (result.getString("country") != null) {
                    l.setCountry(result.getString("country"));
                }
                i.setLabel(l);
            }
            pStatement.close();
            PreparedStatement ps = connection.prepareStatement("select "
                    + "artists.id as artist_id,"
                    + "artists.title as artist_title,"
                    + "artists.country,"
                    + "artists.begin_year,"
                    + "artists.end_year,"
                    + "genres.id as genre_id,"
                    + "genres.title as genre_title,"
                    + "genres.description "
                    + "from artists join genres on artists.genre_id=genres.id "
                    + "where artists.id in ("+
                    "select artist_id from tracks where item_id=?)");
            ps.setInt(1, id);
            ArrayList<Artist> artists = new ArrayList<Artist>();
            //execute because query should return more than one row
            //ResultSet result2 = ps.executeQuery();
            if (!ps.execute()) {
                i.setArtists(artists);
                return i;
            }
            ResultSet result2 = ps.getResultSet();
            while (result2.next()) {
                Genre g = new Genre(result2.getInt("genre_id"),
                        result2.getString("genre_title"),
                        result2.getString("description"));
                Artist a = new Artist(result2.getInt("artist_id"),
                        result2.getString("artist_title"), g);
                if (result2.getString("country") != null) {
                    a.setCountry(result2.getString("country"));
                }
                if (result2.getInt("begin_year") != 0) {
                    a.setBeginYear(result2.getInt("begin_year"));
                }
                if (result2.getInt("end_year") != 0) {
                    a.setEndYear(result2.getInt("end_year"));
                }
                artists.add(a);
            }
            pStatement.close();
            i.setArtists(artists);
            i.setPrice(this.getPriceOfItem(id));
            return i;
        } else {
            result.close();
            pStatement.close();
            return null;
        }
    }