public void doPost ( HttpServletRequest req, HttpServletResponse res ) 	throws ServletException,IOException {
UpdateItem updateItem = new UpdateItem ( ) ;
String url = "jdbc:oracle:thin:@localhost:1521:etri" ;
Connection con ;
Statement stmt ;
res.setContentType ( "text/html ;charset = euc-kr" ) ;
out = res.getWriter ( ) ;
num = Integer.parseInt ( req.getParameter ( "num" ) ) ;
email = req.getParameter ( "email" ) ;
title = req.getParameter ( "title" ) ;
content = req.getParameter ( "content" ) ;
password = req.getParameter ( "password" ) ;
date = new Date ( ) ;
try {
updateItem.loadDriver ( ) ;
}
catch ( java.lang.ClassNotFoundException e ) {
System.err.print ( "ClassNotFoundException:" ) ;
System.err.println ( e.getMessage ( ) ) ;
}
catch ( Exception e ) {
System.err.println ( e ) ;
}
out.println ( HTMLLib.getHTMLTitle ( "글 수정" ) ) ;
out.println ( "<body>" ) ;
try {
updateItem.update ( num, email, title, content, password, req.getRemoteAddr ( ) ) ;
}
catch ( SQLException ex ) {
System.err.println ( "SQLException : " + ex.getMessage ( ) ) ;
}
out.println ( "<script>alert ( '수정이 완료되었습니다.' ) ;self.location = 'BoardList_db'</script>" ) ;
out.println ( "</body></html>" ) ;
}
public String toHangul ( String str ) {
if ( str == null ) return null;
try {
return new String ( str.getBytes ( "8859_1" ) , "KSC5601" ) ;
} catch ( UnsupportedEncodingException e ) {
}
return null ;
}
public String hangulTo ( String str ) {
if ( str == null ) return null;
try {
return new String ( str.getBytes ( "KSC5601" ) , "8859_1" ) ;
} catch ( UnsupportedEncodingException e ) {
}
return null ;
}
