@Override
	public void updateIngredient(Ingredient c) throws IngredientRepositoryException {
		validate(c);
		try(Connection connection = DriverManager.getConnection(connectionString)){
			PreparedStatement statement = connection.prepareStatement("update ingredient set name = ? where id = ? ");
			statement.setString(1, c.getName().toUpperCase(Locale.ENGLISH));
			statement.setInt(2, c.getIngredientId());
			statement.executeUpdate();
			statement = connection.prepareStatement("delete from parent where idIngredient = ?");
			statement.setInt(1, c.getIngredientId());
			statement.executeUpdate();
			for(int parent : c.getParentIngredients()){
				statement = connection.prepareStatement("insert into parent values (?,?)");
				statement.setInt(1, c.getIngredientId());
				statement.setInt(2, parent);
				statement.executeUpdate();
			}
			connection.close();
		}
		catch(SQLException ex){
			ex.printStackTrace();
			System.exit(-1);
		}
	}