[spring-jdbc-1] haon.lee(이민성) 과제 제출합니다.#37
Open
msung99 wants to merge 8 commits intoJapring-Study:haon/spring-jdbc-1from
Open
[spring-jdbc-1] haon.lee(이민성) 과제 제출합니다.#37msung99 wants to merge 8 commits intoJapring-Study:haon/spring-jdbc-1from
msung99 wants to merge 8 commits intoJapring-Study:haon/spring-jdbc-1from
Conversation
swandevson
reviewed
Aug 15, 2024
| public int count() { | ||
| //TODO : customers 디비에 포함되어있는 row가 몇개인지 확인하는 기능 구현 | ||
| return 0; | ||
| return jdbcTemplate.queryForObject("select count(*) from customers", Integer.class); |
There was a problem hiding this comment.
가독성을 위해 SQL 예약어(SELECT, FROM 등)은 대문자로 작성하시는 것이 좋을 것 같습니다!
alreadysons
reviewed
Aug 17, 2024
| //todo : keyHolder에 대해 학습하고, Customer를 저장후 저장된 Customer의 id를 반환하기 | ||
| jdbcTemplate.update(connection -> { | ||
| PreparedStatement ps = connection.prepareStatement( | ||
| "insert into customers (first_name, last_name) values (?, ?)", |
dayaelee
reviewed
Aug 19, 2024
Member
dayaelee
left a comment
There was a problem hiding this comment.
목적에 맞게 코드를 잘 작성하신 것 같습니다. 고생하셨습니다!
| public int delete(Long id) { | ||
| //todo: id에 해당하는 customer를 지우고, 해당 쿼리에 영향받는 row 수반환하기 | ||
| return 0; | ||
| return jdbcTemplate.update("delete from customers where id = ?", Long.valueOf(id)); |
Member
There was a problem hiding this comment.
제가 아직 자바에 익숙치 않은데, 이렇게도 코드를 간략하게 작성할 수 있음에 감탄하고 덕분에 한 수 배워갑니다~!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
haon(하온) JDBC 미션 제출합니다 🙂