Beispiel #1
0
 public void BoardReplyAction(BoardVO bVo) {
   String sql = "update qna set anwser=? where num=?";
   try {
     conn = getConnection();
     pstmt = conn.prepareStatement(sql);
     pstmt.setString(1, bVo.getAnwser());
     pstmt.setInt(2, bVo.getNum());
     pstmt.executeUpdate();
   } catch (Exception e) {
     e.printStackTrace();
   } finally {
     CloseUtil.close(pstmt);
     CloseUtil.close(conn);
   }
 }
Beispiel #2
0
 // 매개 변수로 받은 vo객체 내의 코드로 qna테이블에서 검색해서 vo객체에 저장된 정보로 게시글 정보를 수정한다
 public void updateBoard(BoardVO bVo) {
   String sql =
       "update qna set " + "subject=?, content=?, reg_date=sysdate where num=? and mnum=?";
   int result = 0;
   try {
     conn = getConnection();
     pstmt = conn.prepareStatement(sql);
     pstmt.setString(1, bVo.getSubject());
     pstmt.setString(2, bVo.getContent());
     pstmt.setInt(3, bVo.getNum());
     pstmt.setInt(4, bVo.getMnum());
     result = pstmt.executeUpdate();
     System.out.println(result + "개의 행이 수정되었습니다..");
   } catch (Exception e) {
     e.printStackTrace();
   } finally {
     CloseUtil.close(pstmt);
     CloseUtil.close(conn);
   }
 }