public void doPost ( HttpServletRequest req, HttpServletResponse res ) 	throws ServletException,IOException {
String url = "jdbc:oracle:thin:@localhost:1521:etri" ;
Connection con ;
Statement stmt ;
InsertItem insertItem = new InsertItem ( ) ;
res.setContentType ( "text/html ;charset = euc-kr" ) ;
out = res.getWriter ( ) ;
name = req.getParameter ( "name" ) ;
email = req.getParameter ( "email" ) ;
title = req.getParameter ( "title" ) ;
content = req.getParameter ( "content" ) ;
password = req.getParameter ( "password" ) ;
BoardData data = new BoardData ( 0, null, title, name, email, password, content ) ;
try {
insertItem.loadDriver ( ) ;
}
catch ( java.lang.ClassNotFoundException e ) {
System.err.print ( "ClassNotFoundException:" ) ;
System.err.println ( e.getMessage ( ) ) ;
} catch ( Exception e ) {
System.err.println ( e ) ;
}
out.println ( "<html><head><title> ۼ</title>" ) ;
out.println ( "</head>" ) ;
out.println ( "<body background = /images/back.gif>" ) ;
try {
insertItem.insert ( data, req.getRemoteAddr ( ) ) ;
out.println ( "<script>alert ( 'ڷᰡ ߰Ǿϴ.' ) ;self.location = 'BoardList_db'</script>" ) ;
} catch ( SQLException ex ) {
System.err.println ( "SQLException : " + ex.getMessage ( ) ) ;
out.println ( "<script>alert ( 'ڷ ߰ Ͽϴ.' ) ;history.back ( ) </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 ;
}
