@Override
	public Recipe getRecipeById(int recipeId) {
		try (Connection connection = DriverManager.getConnection(connectionString)) {
			Recipe recipe = new Recipe();
			/* TODO: check the impact of fetching everything in one query */
			PreparedStatement statement = connection.prepareStatement("select id, name, numPersons, cookingTime, restingTime, prepTime, steps from recipe where id = ?");
			statement.setInt(1, recipeId);
			ResultSet rs = statement.executeQuery();
			if(!rs.next()){
				return null;
			}
			recipe.setRecipeId(rs.getInt("id"));
			recipe.setName(rs.getString("name"));
			recipe.setNumPersons(rs.getInt("numPersons"));
			recipe.setCookingTime(rs.getInt("cookingTime"));
			recipe.setPrepTime(rs.getInt("prepTime"));
			recipe.setRestTime(rs.getInt("restingTime"));
			recipe.setSteps(rs.getString("steps"));
			statement = connection.prepareStatement("select idIngredient, unit, numberOfUnits, fuzzy from recipeIngredients where idRecipe = ?");
			statement.setInt(1, recipeId);
			rs = statement.executeQuery();
			while(rs.next()){
				Quantity q = new Quantity();
				q.setFuzzy(rs.getBoolean("fuzzy"));
				q.setNumberOfUnits(rs.getBigDecimal("numberOfUnits"));
				q.setUnit(rs.getString("unit"));
				Ingredient i = ingredientRepository.getIngredient(rs.getInt("idIngredient"));
				recipe.addIngredient(i, q);
			}
			connection.close();
			return recipe;
		}
		catch(SQLException ex){
			ex.printStackTrace();
			return null;
		}
	}