[SpringMVC] ๊ฒŒ์‹œํŒ ๋งŒ๋“ค๊ธฐ - ๊ฒŒ์‹œ๋ฌผ ์กฐํšŒ

IBoardDAO.java ๋‹ค์Œ ๋ฉ”์„œ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค. 1 2 //2. ํ•˜๋‚˜์˜ ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ ๊ธฐ๋Šฅ ๋ฉ”์„œ๋“œ - ํ•˜๋‚˜๋ฅผ ์กฐํšŒํ•˜๋ ค๋ฉด ํ”„๋ผ์ด๋จธ๋ฆฌํ‚ค(๊ธ€๋ฒˆํ˜ธ)๋ฅผ ๊ฐ€์ ธ์™€ ์ „์ฒด ์ •๋ณด๋ฅผ ๋ฐ˜ํ™˜ํ•œ๋‹ค. BoardVO getArticle(int boardNo) throws Exception; BoardMapper.xml ๋‹จ์ผ ๊ฒŒ์‹œ๋ฌผ์„ ์กฐํšŒํ•˜๋Š” SQL ๋ฌธ ์ž‘์„ฑ 1 2 3 4 select * from mvc_board where board_no = #{boardNo} ๋ฏธ๋ฆฌ resultMap์„ ๋งŒ๋“ค์–ด ๋‘์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ๋งŒ๋“ค์–ด๋‘์—ˆ๋˜ ์ด๋ฆ„์„ ์ ์–ด ์‚ฌ์šฉํ•œ๋‹ค. ํŒจํ‚ค์ง€์ด๋ฆ„์„ ๊ธธ๊ฒŒ ์•ˆ์จ๋„ ๋˜๋Š” ์žฅ์ ์ด ์žˆ๋‹ค. ์˜คํƒ€๋ฐฉ์ง€ ! ์œ ์ง€๋ณด์ˆ˜ ํšจ์œจ์„ฑ ์ƒ์ƒ์„ฑ ์ฆ๊ฐ€ ! BoardDAO.java 1 2 3 4 5 6 //2. ํ•˜๋‚˜์˜ ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ ๊ธฐ๋Šฅ ๋ฉ”์„œ๋“œ - ํ•˜๋‚˜๋ฅผ ์กฐ..

Project/SpringMVC 2019. 7. 25. 16:15