public List<Employee> searchEmployeesBasedOnAttributes(Attribute[] attributes) throws Fly5Exception
	{
		Employee employee=null;
		String query="";
		StringBuilder sb=new StringBuilder("select * from Employee where ");
		List<Employee> listOfEmployees=new ArrayList<Employee>();
		for(int i=0;i<attributes.length;i++)
		{
			
			sb.append(attributes[i].getAttributeName());
			sb.append("=");
			sb.append("?");
			
			if(i<attributes.length-1)
			{
				sb.append(" and ");
			}
			
		}
		sb.append(";");
		
		query = sb.toString();
		System.out.println(query);
		Connection con=null;
		PreparedStatement ps=null;
		
		try
		{
			con=ConnectionFactory.getInstance().getConnection();
			ps=con.prepareStatement(query);
			
			
			
			for(int i = 0; i<attributes.length;i++)
			{
				if(attributes[i].getAttributeName().equals("employee_id"))
				{
					ps.setInt(i+1, new Integer(attributes[i].getAttributeValue()).intValue());
					System.out.println("The employee id is"+attributes[i].getAttributeValue());
					
					
				}
				 if(attributes[i].getAttributeName().equals("position"))
				{
					ps.setString(i+1, attributes[i].getAttributeValue());
					System.out.println("The position is"+attributes[i].getAttributeValue());
				}
				 if(attributes[i].getAttributeName().equals("hire_date"))
				{
					ps.setString(i+1, attributes[i].getAttributeValue());
					System.out.println("The Hire Date is"+attributes[i].getAttributeValue());
				}
				 if(attributes[i].getAttributeName().equals("crew_id"))
				{
					ps.setInt(i+1, new Integer(attributes[i].getAttributeValue()).intValue());
					System.out.println("The crew id is"+attributes[i].getAttributeValue());
				}
				
				
			}
			
			
			ResultSet rs=ps.executeQuery();
			
			while(rs.next())
			{
				employee=new Employee();
				employee=getEmployeePersonalDetails(rs.getLong(1));
				employee.setEmployeeID(rs.getLong(Fly5Constants.EMPLOYEE_ID_INDEX));
				employee.setWorkDescription(rs.getString(Fly5Constants.WORK_DESCRIPTION_INDEX));
				employee.setDesignation(rs.getString(Fly5Constants.POSITION_INDEX));
				employee.setHireDate(rs.getDate(Fly5Constants.HIRE_DATE_INDEX));
				employee.setCrewID(rs.getLong(Fly5Constants.CREW_ID_INDEX));
				
				listOfEmployees.add(employee);
			}
			
			
			
		}
		catch(SQLException e)
		{
			e.printStackTrace();
		}
		finally
		{
			ConnectionFactory.getInstance().closeConnection(con);
		}
		
		
		return listOfEmployees;
	}