Package kr.pe.okjsp

Examples of kr.pe.okjsp.Article


  private final String OKBOARD_LIST_BY_SID = "select * from okboard where id = ? order by seq desc";
  DbCon dbCon = new DbCon();
 

  private Article getArticle(ResultSet rs) throws SQLException {
    Article row = new Article();
    row.setBbs(rs.getString("bbsid"));
    row.setSubject(rs.getString("subject"));
    row.setContent(rs.getString("content"));
    row.setRead(rs.getInt("hit"));
    row.setMemo(rs.getInt("memo"));
    row.setWhen(rs.getTimestamp("wtime"));
    row.setSeq(rs.getInt("seq"));
    row.setWriter(rs.getString("writer"));
    return row;
  }
View Full Code Here


  private String write(HttpServletRequest req, HttpServletResponse res) throws IOException {
    Member member = (Member)req.getSession().getAttribute("member");
    String id  = member.getId();
    long sid = member.getSid();
   
    Article article = new Article();
    article.setId(id);
    article.setSid(sid);
    String writer = req.getParameter("writer");
    String bbs = req.getParameter("bbs");
    String content = req.getParameter("content");
    String subject = req.getParameter("subject");
    String homepage = req.getParameter("homepage");
    String password = req.getParameter("password");
    String ccl_id = req.getParameter("ccl_id");

    article.setWriter(writer);
    article.setBbs(bbs);
    article.setContent(content);
    article.setSubject(subject);
    article.setHomepage(homepage);
    article.setPassword(password);
    article.setCcl_id(ccl_id);
   
    new ArticleDao().write(article);
   
    return article.getBbs();
  }
View Full Code Here

        db ��������
    */
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    Article article = new Article();
    try {
      conn = dbCon.getConnection();

      // �Խù� ��������
      pstmt = conn.prepareStatement(QUERY_PASSWORD);
      pstmt.setInt(1, seq);
      pstmt.setString(2, confirmPassword);

      rs = pstmt.executeQuery();
      int passwordCount = 0;
      if (rs.next()) {
        passwordCount++;
        article.setBbs(rs.getString("bbsid"));
      }

      rs.close();
      pstmt.close();

View Full Code Here

    member.setId("kenu1");
    return member;
  }

  public static Article getTestArticle(Member member) {
    Article article = new Article();
    article.setBbs("recruit");
    article.setSubject("subject");
    article.setId(String.valueOf(member.getSid()));
    article.setSid(member.getSid());
    article.setContent("content");
    article.setWriter(member.getId());
    return article;
  }
View Full Code Here

    Member member = TestObject.getTestMember();

    // �۾��� 10��, code 2
    long pointBefore =  pointDao.getPoint(member.getSid());
    ArticleDao articleDao = new ArticleDao();
    Article article = new Article();
    Connection conn = new DbCon().getConnection();
    int seq = articleDao.getSeq(conn);
    article.setSeq(seq);
    article.setBbs("perf");
    article.setSubject("subject");
    article.setId(member.getId());
    article.setSid(member.getSid());
    article.setContent("content");
    article.setWriter(member.getId());
    int result = articleDao.write(conn , article);
    assertTrue(1 < result);
    long pointAfter = pointDao.getPoint(member.getSid());
    assertEquals(10, pointAfter - pointBefore);
  }
View Full Code Here

  public void testFormatDate() {
  }

  public void testShowHtml() {
    String str = "hello\r\nhello2";
    Article article = new Article();
    article.setContent(str);
    article.setHtml("0");
    assertEquals("hello\r<br>hello2", article.getContentView());
    article.setHtml("1");
    assertEquals("hello\r\nhello2", article.getContentView());
    article.setHtml("2");
    assertEquals(str, article.getContentView());
    article.setHtml("0   ");
    assertEquals("hello\r<br>hello2", article.getContentView());
    article.setHtml("1   ");
    assertEquals("hello\r\nhello2", article.getContentView());
    article.setHtml("2   ");
    assertEquals(str, article.getContentView());
  }
View Full Code Here

TOP

Related Classes of kr.pe.okjsp.Article

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.