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());