@Override
	public String[] userServices(String username) {
		List<String> userServicesList = new ArrayList<String>();
		String serviceName, userType, table;
		ResultSet rs;

		try {
			// get table according to user type
			userType = userType(username);
			
			// check if the user actually exists
			if (userType == null)
				return null;
			
			table = tableName(userType);
			
			PreparedStatement statement = connection
					.prepareStatement("SELECT * FROM " + table
							+ " WHERE username = ?");

			statement.setString(1, username);

			rs = statement.executeQuery();

			while (rs.next()) {
				serviceName = rs.getString("service");
				userServicesList.add(serviceName);
			}

			rs.close();

		} catch (SQLException e) {
			e.printStackTrace();
		}

		return Arrays.copyOf(userServicesList.toArray(), userServicesList.size(), String[].class);
	}