1. BoardDAO.java : 인터페이스public BoardVO read(Integer bno) throws Exception; 2. mapperSELECTbno, title, content, writer, regdate, viewcntFROMtbl_boardWHERE bno = #{bno} 3. BoardDAOImpl.java@Override public BoardVO read(Integer bno) throws Exception { return session.selectOne(namespace + ".read", bno); } 4. BoardService.java : 인터페이스public BoardVO read(Integer bno) throws Exception; 5. BoardServiceI..
1. BoardDAO.java : 인터페이스public List listAll() throws Exception; 2. mapper SELECT bno, title, content, writer, regdate, viewcnt FROM tbl_board WHERE bno > 0 ORDER BY bno desc, regdate desc ]]> 3. BoardDAOImpl.java@Override public List listAll() throws Exception { return session.selectList(namespace + ".listAll"); } 4. BoardService.java : 인터페이스public List listAll() throws Exception;\ 5. BoardServi..
* 입력 1. VO작성 : 테이블의 구조를 객체화 2. BoardDAO.java : 인터페이스public void create(BoardVO vo) throws Exception; 3. mapperINSERT INTO tbl_board (title, content, writer)values(#{title},#{content}, #{writer}) 4. BoardDAOImpl.java : SqlsessionTemplate을 이용해서 원하는 코드 호출@Inject private SqlSession session; private static String namespace = "org.zerock.mapper.BoardMapper"; @Override public void create(BoardVO vo) th..