<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.Enumeration" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.sql.Connection" %>
<%@ page import = "java.sql.DriverManager" %>
<%@ page import = "java.sql.PreparedStatement" %>
<%@ page import = "java.sql.ResultSet" %>
<!DOCTYPE html>
<html>
<head>
<link href='../../css/join_style.css.css' rel='stylesheet' style='text/css'/>
<title>가입결과</title>
</head>
<body>
<% request.setCharacterEncoding("utf-8"); %>
<%
	String id = request.getParameter("id");
	String password = request.getParameter("password");   
	String passwordcheck = request.getParameter("passwordcheck");
	String name = request.getParameter("name");
	String gender = request.getParameter("gender");
	String birthyy = request.getParameter("birthyy");
	String birthdd = request.getParameter("birthdd");
	String birthmm = request.getParameter("birthmm");
	String email1 = request.getParameter("email1");
	String email2 = request.getParameter("email2");
	String phone = request.getParameter("phone");
	String address = request.getParameter("address");
	String str = "";
	String birth = birthyy+"-"+birthdd+"-"+birthmm;
	String email = email1+"@"+email2;

try{
	   Class.forName("oracle.jdbc.driver.OracleDriver");
	   Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20150001","960323");
	   PreparedStatement pstmt=conn.prepareStatement
			   ("insert into O_MEMBER2(id,password,passwordcheck,name,gender,birth,email,phone,address) values(?,?,?,?,?,?,?,?,?)");
		   pstmt.setString(1, id);
		   pstmt.setString(2, password);
		   pstmt.setString(3, passwordcheck);
		   pstmt.setString(4, name);
		   pstmt.setString(5, gender);
		   pstmt.setString(6, birth);
		   pstmt.setString(7, email);
		   pstmt.setString(8, phone);
		   pstmt.setString(9, address);
		   
		   pstmt.executeUpdate();
		   pstmt.close();
		   conn.close();
		   
		   str="회원가입에 성공하셧습니다.";
	}catch(Exception e) {
		   e.printStackTrace();
		   str="회원가입에 실패했습니다.";
	}
%>


<!DOCTYPE html>
<html>
<head>
<body>
<p style="text-align:center;">
<a style="font-size:20px;">
<%= str %>   <p>
<A href="http://localhost:8080/JSP_DEV/member/view/LoginForm.jsp">
<p style="text-align:center;">
<input type = "button" value="메인화면" class = "btn"></A>
</body>
</html>