Package kr.pe.okjsp

Examples of kr.pe.okjsp.MemoDao


      conn = dbCon.getConnection();
      conn.setAutoCommit(false);

      int memocnt = 0;
      MemoDao memoDao = new MemoDao();
      if (MASTER_MEMO.equals(delpass)) {
        // memo ����
        pstmt = conn.prepareStatement(QUERY_MEMO_DEL2);
        pstmt.setInt(1, mseq);
        memocnt = pstmt.executeUpdate();
        pstmt.close();
        memocnt = -memocnt;
      } else if (mseq > 0 && !"".equals(delpass)) {
        // memo ����
        pstmt = conn.prepareStatement(QUERY_MEMO_DEL);
        pstmt.setString(1, delpass);
        pstmt.setInt(2, mseq);
        memocnt = pstmt.executeUpdate();
        pstmt.close();
        memocnt = -memocnt;
      } else {
        // id cookie based
        long sid = CommonUtil.getCookieLong(req, "sid");
        String id = null;
        if (sid > 0) {
          id = CommonUtil.getCookie(req, "okid");
        }
       
        if( sid == 0 ) {
          sid = Long.parseLong( req.getParameter("sid") );
          id = req.getParameter("okid");
        }
       
        memocnt = memoDao.write(conn, id, sid, writer, bcomment,
            memopass, ip, seq);
        CommonUtil.setCookie(DomainUtil.getBaseDomain(req.getRequestURL()), res, "memo", "true", 525600);
      }

      memoDao.setCount(conn, seq, memocnt);
      conn.commit();

      CommonUtil.setCookie(DomainUtil.getBaseDomain(req.getRequestURL()), res, "okwriter", writer);
    } catch (Exception e) {
      System.out.println("MemoServlet:" + e.toString());
View Full Code Here


   
    // �޸�� 1��, code 4
    long pointBefore =  pointDao.getPoint(member.getSid());
    MemoBean memoBean = new MemoBean();
    memoBean.setBcomment("memo test");
    MemoDao memoDao = new MemoDao();
    DbCon dbCon = new DbCon();
    Connection conn = dbCon.getConnection();
    conn.setAutoCommit(false);
    String bcomment = memoBean.getBcomment();
    String writer = member.getId();
    long sid = member.getSid();
    String id = member.getId();
    String memopass = "okpass";
    String ip = "";
    int seq = 0;
    memoDao.write(conn, id, sid, writer, bcomment, memopass, ip, seq);
    long pointAfter = pointDao.getPoint(member.getSid());
    assertEquals(1, pointAfter - pointBefore);
    conn.setAutoCommit(true);
    // �޸�� ���� 0��, code 5
    // ��ǥ 1�� code 6
View Full Code Here

TOP

Related Classes of kr.pe.okjsp.MemoDao

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.