public ArrayList<String> getBuddies(String user){
		ArrayList<String> buddies= new ArrayList<String>();
		Statement st;
		ResultSet rs;
		String query;	
		try {
			st = conn.createStatement();
			query="SELECT t.friend1 FROM"
					+" (SELECT * FROM friends f where f.friend1='"+user+"' OR f.friend2 = '"+user+"')t"
					+" JOIN friends w ON t.friend1=w.friend2 AND t.friend2=w.friend1 AND t.friend1!='"+user+"'";
			rs = st.executeQuery(query);
			while (rs.next()){
				buddies.add(rs.getString(1));
			}
			rs.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return buddies;
	}