<%@ 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 passwd= request.getParameter("password");
   String name = request.getParameter("name"); 
   String email = request.getParameter("email");
   String phoneNum = request.getParameter("phoneNum");
   String gender = request.getParameter("gender");
   String year = request.getParameter("year");
   String month = request.getParameter("month");
   String day = request.getParameter("day");
      
   String str="";
   
   try{
	 
	   Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162486","970409");
		PreparedStatement pstmt=conn.prepareStatement("insert into MEMBER_2A(id,password,name,gender,year,month,day,email,phoneNum) values(?,?,?,?,?,?,?,?,?)");
		pstmt.setString(1, id);
		pstmt.setString(2, passwd);
		pstmt.setString(3, name);
		pstmt.setString(4, gender);
		pstmt.setString(5, year);
		pstmt.setString(6, month);
		pstmt.setString(7, day);
		pstmt.setString(8, email);
		pstmt.setString(9, phoneNum);
		
		pstmt.executeUpdate();
		pstmt.close();
		conn.close();  

		response.sendRedirect("inputok.jsp");
		
 	}catch(Exception e){ 
 
 		e.printStackTrace();
 
 	}finally{
 		
 		
 	}
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body bgcolor="F5F5DC">
<script>
alert("정보를 입력해 주세요.");
location.href="loginForm.jsp";
</script>
</body>
</html>
