@Override
  public void update(Product product) throws SQLException {
    var sql = "update PRODUCTS set price = ?, expiration_date = ? where name = ?;";
    try (var connection = dataSource.getConnection();
        var preparedStatement = connection.prepareStatement(sql)) {
      preparedStatement.setBigDecimal(1, product.getPrice().getAmount());
      preparedStatement.setDate(2, Date.valueOf(product.getExpirationDate()));
      preparedStatement.setString(3, product.getName());
      preparedStatement.executeUpdate();
    }
  }
@Test
    void shouldUpdateProduct() throws SQLException {
        TestUtils.executeSQL(INSERT_PRODUCT_SQL, dataSource);

        product.setPrice(Money.of(USD, 99.0));

        productDao.update(product);

        try (var connection = dataSource.getConnection();
             var statement = connection.createStatement();
             ResultSet rs = statement.executeQuery(SELECT_PRODUCTS_SQL)) {

            assertTrue(rs.next());
            assertEquals(product.getName(), rs.getString("name"));
            assertEquals(product.getPrice(), Money.of(USD, rs.getBigDecimal("price")));
            assertEquals(product.getExpirationDate(), rs.getDate("expiration_date").toLocalDate());
        }
    }