Skip to content

Commit

Permalink
java pizza project #2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
biblelamp committed Jun 15, 2024
1 parent 84816ae commit d1e2fde
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer, Customer> {

Expand Down Expand Up @@ -97,7 +97,13 @@ public Collection<Customer> 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
Expand Down

0 comments on commit d1e2fde

Please sign in to comment.