<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
 

<% request.setCharacterEncoding("utf-8");%>

<% 
   String id = request.getParameter("id");
   String password = request.getParameter("password");
   String repassword = request.getParameter("repassword");
   String name = request.getParameter("name");    
   String birth = request.getParameter("birth"); 
   String phone = request.getParameter("phone"); 
   String email = request.getParameter("email"); 
      
   String str="";
   
   try{
	 
	   Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20182234","990802");
		PreparedStatement pstmt=conn.prepareStatement("insert into MEMBER(id,password,repassword,name,birth,phone,email) values(?,?,?,?,?,?,?)");
		pstmt.setString(1, id);
		pstmt.setString(2, password);
		pstmt.setString(3, repassword);
		pstmt.setString(4, name);
		pstmt.setString(5, birth);
		pstmt.setString(6, phone);
		pstmt.setString(7, email);
		
		pstmt.executeUpdate();
		pstmt.close();
		conn.close();  
	 	 
 	 str= "MEMBER Table Join Successed.";
 	}catch(Exception e){ 
 		e.printStackTrace();
 		str="MEMBER Table Join Failed";
	
 	}
 %>
<html>
<head>
<style>
body{
		background-color:black;
	}
	</style>
<title>Join Page</title>
</head>
<body>
  <%=str %>  <p>
  
     <script>
alert("Join Successed !");
location.href="loginForm.jsp";
</script>
  
</body>
</html>