public String execute() throws Exception {
		String result = ERROR;
		DatabaseManager dbManager = new DatabaseManager();
		
		HttpServletRequest request = ServletActionContext.getRequest();
		int page = request.getParameter("page") != null ? Integer.parseInt(request.getParameter("page")) : 1;
		int limitStart = page*10 - 10;
		int limitEnd = page*10;
		int totalRecords = 0;
		
		String orderBy = request.getParameter("orderBy") != null ? request.getParameter("orderBy") : "name";
		String type = request.getParameter("type") != null ? request.getParameter("type") : "asc";
		
		request.setAttribute("orderBy", orderBy);
		if (request.getParameter("type") == null) {
			request.setAttribute("type", "asc");
			request.setAttribute("newType", "desc");
		} else {
			request.setAttribute("type", request.getParameter("type"));
			request.setAttribute("newType", type.equalsIgnoreCase("asc") ? "desc" : "asc");
		}
		request.setAttribute("sortImage", request.getAttribute("type").toString().equalsIgnoreCase("asc") ? "images/arr_up.png" : "images/arr_down.png");

		try {
			StringBuilder sql = new StringBuilder();
			sql.append("SELECT * FROM genres ");
			sql.append("ORDER BY " + orderBy + " " + type + " ");
			sql.append("LIMIT " + limitStart + ", " + limitEnd);

			PreparedStatement stmt = dbManager.prepStatement(sql);
			ResultSet rs = stmt.executeQuery();

			while (rs.next()) {
				this.genresList.add(new Genres(rs));
			}
			
			sql.delete(0, sql.length());
			sql.append("SELECT COUNT(g.id) as records_num FROM genres g");
			stmt = dbManager.prepStatement(sql);
			rs = stmt.executeQuery();
			
			while (rs.next()) {
				totalRecords = rs.getInt("records_num");
			}
			
			request.setAttribute("currentPage",page);
			request.setAttribute("totalPages", Math.ceil(totalRecords/10)+1);
			result = SUCCESS;
			
		} catch (Exception e) {
			e.printStackTrace();
			result = ERROR;
		} finally {
			dbManager.close();
		}

		return result;
	}