@Override
	public int addRecipe(Recipe r) {
		int recipeId = getNextIdAndIncrement();
		try(Connection connection = DriverManager.getConnection(connectionString)){
			PreparedStatement statement = connection.prepareStatement("insert into recipe (id, name, numPersons, cookingTime, restingTime, prepTime, steps) values (?,?,?,?,?,?,?)");
			statement.setInt(1, recipeId);
			statement.setString(2, r.getName());
			statement.setInt(3, r.getNumPersons());
			statement.setLong(4, r.getCookingTime().getStandardMinutes());
			statement.setLong(5, r.getRestTime().getStandardMinutes());
			statement.setLong(6, r.getPrepTime().getStandardMinutes());
			String steps = "";
			for(String step : r.getSteps()){
				steps = steps + step + "\n";
			}
			statement.setString(7, steps);
			statement.executeUpdate();
			
			for(Ingredient i : r.getIngredients().keySet()){
				statement = connection.prepareStatement("insert into recipeIngredients (idRecipe, idIngredient, unit, numberOfUnits, fuzzy) values (?,?,?,?,?)");
				statement.setInt(1, recipeId);
				statement.setInt(2, i.getIngredientId());
				Quantity q = r.getIngredients().get(i);
				statement.setString(3, q.getUnit());
				statement.setBigDecimal(4, q.getNumberOfUnits());
				statement.setBoolean(5, q.isFuzzy());
				statement.executeUpdate();
			}
			connection.close();
			return recipeId;
		}
		catch(SQLException ex){
			ex.printStackTrace();
			return -1;
		}
		
	}