<%@page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" import="java.sql.*"%>
<%
String writer = request.getParameter("writer");
String title = request.getParameter("title");
String contents = request.getParameter("contents");
String regdate = request.getParameter("regdate");
//DB Connection
String user = "root";
String password = "root";
String driver = "com.mysql.jdbc.Driver";
String url ="jdbc:mysql://localhost:3306/wonword";
Connection conn = null;
Class.forName(driver);
String sql = "insert into board(writer,title,contents,regdate) values('"+writer+"','"+title+"','"+contents+"','"+regdate+"');";
conn = DriverManager.getConnection(url,user,password);
PreparedStatement stmt = conn.prepareStatement(sql);
stmt.executeUpdate();
%>
<root>
<item>success</item>
</root>