diff --git a/BerlinAIT/Cohort42.1project/JavaPizzaMvn/src/main/java/pizza/repository/db/CustomerDbRepository.java b/BerlinAIT/Cohort42.1project/JavaPizzaMvn/src/main/java/pizza/repository/db/CustomerDbRepository.java index 2ed735d1..1da418b5 100644 --- a/BerlinAIT/Cohort42.1project/JavaPizzaMvn/src/main/java/pizza/repository/db/CustomerDbRepository.java +++ b/BerlinAIT/Cohort42.1project/JavaPizzaMvn/src/main/java/pizza/repository/db/CustomerDbRepository.java @@ -16,7 +16,7 @@ * Implementation of access methods to the Customer data source * * @author Sergey Iryupin - * @version 12-Jun-24 + * @version 15-Jun-24 */ public class CustomerDbRepository implements CrudRepository { @@ -97,7 +97,13 @@ public Collection findAll() { @Override public void deleteById(Integer id) { - + try (Connection connection = DriverManager.getConnection(dbName); + PreparedStatement ps = connection.prepareStatement(SQL_DELETE_BY_ID)) { + ps.setInt(1, id); + ps.executeUpdate(); + } catch (SQLException e) { + throw new RuntimeException(e); + } } @Override