String sql_selectSeq = " select * from board where seq=? ";
public BoardVO selectSeq(int s) {
BoardVO vo = new BoardVO();
try {
con = db.dbconn();
pstmt = con.prepareStatement(sql_selectSeq);
pstmt.setInt(1, s);
rs = pstmt.executeQuery();
list = new ArrayList<BoardVO>();
rs.next();
vo.setSeq(rs.getInt("seq"));
vo.setTitle(rs.getString("title"));
vo.setWriter(rs.getString("writer"));
vo.setContent(rs.getString("content"));
vo.setRegDate(rs.getDate("regdate"));
vo.setCnt(rs.getString("cnt"));
} catch (Exception e) {
e.printStackTrace();
}finally {
db.close(rs, pstmt, con);
}
return vo;
}
int seq = 20;
System.out.println("출력할 seq : "+seq);
BoardVO data = s.selectSeq(seq);
System.out.println(seq +"====>[" +data.toString()+"]");