Skip to content

Commit

Permalink
deleteById 작성하기
Browse files Browse the repository at this point in the history
jdbcTemplate.update()의 결과가 1이면 삭제 성공, 0이면 삭제 실패한 경우이다.

Related to: #37
  • Loading branch information
ahyoon99 committed Aug 19, 2024
1 parent b89a2fc commit 70058f5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ public T save(T entity) {

@Override
public void deleteById(int index) {

String deleteByIdQuery = "delete from restaurant where index=?";
int deleteByIdParam = index;
int result = this.jdbcTemplate.update(deleteByIdQuery, deleteByIdParam);
System.out.println("delete : "+result);
}

@Override
Expand Down

0 comments on commit 70058f5

Please sign in to comment.