public static ArrayList<MediaCopy> searchMediaByGenre(String genre){
		
		try {
			   if(conn == null || conn.isClosed()){
			    conn = DatabaseConnection.getConnection();
			   }
			  } catch (SQLException e1) {
			   // TODO Auto-generated catch block
			   e1.printStackTrace();
			  }
		
		ArrayList<MediaCopy> media = new ArrayList<MediaCopy>();
		try {
			PreparedStatement stmnt = conn.prepareStatement("SELECT * FROM Media m, MediaCopies mc WHERE mc.media_id = m.media_id AND genre LIKE ? AND m.media_id = mc.media_id");
			stmnt.setString(1, genre + "%");
			ResultSet res;
			res = stmnt.executeQuery();
			while(res.next()){
				mediaCopy = new MediaCopy(StringDateSwitcher.toDateYear(res.getString("year")), res.getString("place_of_publication"), res.getString("title"), res.getString("genre"), res.getInt("media_id"), res.getString("creator"), res.getString("producer"), res.getString("type"), res.getInt("copy_id"), res.getBoolean("lendable"));
				media.add(mediaCopy);
			}
		}
			catch(SQLException e){
				e.printStackTrace();
				
				
			}
		
		return media;
	}