}
/*
db �Է�
*/
DbCon dbCon = new DbCon();
Connection conn = null;
ArticleDao articleDao = new ArticleDao();
String act = multi.getParameter("act");
try {
conn = dbCon.getConnection();
conn.setAutoCommit(false);
String[] delFiles = null;
int seq = 0;
if ("MODIFY".equals(act)) {
seq = Integer.parseInt(multi.getParameter("seq"));
delFiles = multi.getParameterValues("delFile");
article.setSeq(seq);
}
if ("REPLY".equals(act)) {
article.setSeq(articleDao.getSeq(conn));
article.setRef(Integer.parseInt(multi.getParameter("ref")));
article.setLev(Integer.parseInt(multi.getParameter("lev")));
article.setStep(
Integer.parseInt(multi.getParameter("step")));
articleDao.reply(conn, article);
} else if ("MODIFY".equals(act)) {
articleDao.modify(conn, article);
articleDao.deleteFiles(conn, delFiles);
} else {
article.setSeq(articleDao.getSeq(conn));
article.setRef(articleDao.getNewRef(conn, article.getBbs()));
articleDao.write(article);
}
articleDao.addFile(conn, article.getSeq(), arrdf);
conn.commit();
} catch (Exception e) {
System.out.println("WriteServlet err:" + CommonUtil.a2k(e.toString()));
} finally {
dbCon.close(conn, null);
}
setWriterCookie(DomainUtil.getBaseDomain(req.getRequestURL()), res, article);
return article.getBbs();