<%
      Statement s = conn.createStatement ();
      String bandname="";
      bandname=reqest.getParameter("band");
      String  albumname="";
      java.sql.Date albumdate = null;
      int albumid=-1;
      
			 query= ("select * from albums where band_id in (select id from bands where name='"+bandname+"')");
			System.out.println(query);			
			s.executeQuery (query);
			rs = s.getResultSet ();
              
      
      
      
      out.println("<br><b>Artist albums:</b><br><br>");
      out.println("<div class=\"albums\">");
      
      
      
		while (rs.next ())
		{
		  
			
			albumname = rs.getString ("name");
			albumid =  rs.getInt("id");
			albumdate = rs.getDate("date");
			//out.println(albumid+" "+albumname+" "+albumdate.toString().substring(0,4));
			
			Statement s2 = conn.createStatement ();
			String query2= ("select * from tracks where album_id ="+albumid);
			System.out.println(query2);			
			s2.executeQuery (query2);
			ResultSet rs2 = s2.getResultSet ();
			ArrayList<Track> songs=null;
			songs = new ArrayList<Track>();
			String albuminfo = ("<b>"+albumname+" ("+albumdate.toString().substring(0,4)+"):</b>");
			songs.add(new Track(albuminfo));
			
			while (rs2.next ())					
        {
                
        songs.add(new Track(rs2.getString ("name")));
        }
      
      request.setAttribute( ("album") , songs );
      

      %>
      
      <display:table name="album" class="table" >         
        <display:column property="track" /> 
        <display:setProperty name="basic.show.header" value="false"/>
      </display:table>

			  
			<%			

			
			
			 out.println("<br>");
			
		}
		
		out.println("</div>");
		
		rs.close ();
		s.close ();

%>