Skip to content

Commit

Permalink
updateById 수정하기
Browse files Browse the repository at this point in the history
- 삭제 성공했으면 1을 return 해주기
- 삭제 실패했으면 0을 return 해주기

Related to: #37
  • Loading branch information
ahyoon99 committed Sep 5, 2024
1 parent 72eb4e4 commit 72899b2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ 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);
if(result==1){
System.out.println("delete success");
}
else if(result==0){
System.out.println("delete fail");
}
}

@Override
Expand Down

0 comments on commit 72899b2

Please sign in to comment.