sql로 처리
String query = "select subject, writer, nvl(email, ' ') email, regip, regdate, hit, replace(nvl(content, ' '), '\n', '<br>') content from board1 where seq=" +seq;
JSP에서 처리
String query = "select subject, writer, email, regip, regdate, hit, content from board1 where seq=" +seq;
rs = stmt.executeQuery(query);
if(rs.next()){
subject = rs.getString("subject");
writer = rs.getString("writer");
email = rs.getString("email") == null? "" : rs.getString("email");
regip = rs.getString("regip");
regdate = rs.getString("regdate");
hit = rs.getInt("hit");
content = rs.getString("content")== null ? "" : rs.getString("content").replaceAll("\n", "<br>");
}
subject = rs.getString("subject");
writer = rs.getString("writer");
email = rs.getString("email") == null? "" : rs.getString("email");
regip = rs.getString("regip");
regdate = rs.getString("regdate");
hit = rs.getInt("hit");
content = rs.getString("content")== null ? "" : rs.getString("content").replaceAll("\n", "<br>");
}
'Study > Programming' 카테고리의 다른 글
JSP 파일 업로드 (0) | 2009.06.03 |
---|---|
jsp에서 파일 업로드 처리 (0) | 2009.06.03 |
JSP 게시판 (0) | 2009.05.29 |
JSP 간단한 게시판 (0) | 2009.05.29 |
JSP Encoder.Decoder (0) | 2009.05.29 |