<%@ 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 name = request.getParameter("name");
   String year = request.getParameter("year");
   String month = request.getParameter("month");
   String day = request.getParameter("day");
   String mailname = request.getParameter("mailname");
   String address = request.getParameter("address");
   String email1 = request.getParameter("email");
   String email2 = request.getParameter("email1");
   String email = email1 + "@" + email2;
   String job = request.getParameter("job");  
      
   String str="";
   
   try{
	 
	   Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162487","970901");
		PreparedStatement pstmt=conn.prepareStatement("insert into member(ID,password,name,year,month,day,mailname,address,email,job) values(?,?,?,?,?,?,?,?,?,?)");
		pstmt.setString(1, ID);
		pstmt.setString(2, password);
		pstmt.setString(3, name);
		pstmt.setString(4, year);
		pstmt.setString(5, month);
		pstmt.setString(6, day);
		pstmt.setString(7, mailname);
		pstmt.setString(8, address);
		pstmt.setString(9, email);
		pstmt.setString(10, job);
		
		pstmt.executeUpdate();
		pstmt.close();
		conn.close();  
	 	 
 	 str= "회원가입이 완료되었습니다.";
 	}catch(Exception e){ 
 		e.printStackTrace();
 		str="회원가입을 다시 시도해 주세요.";
	
 	}
 %>
<html align="center">
<head>
<title>회원가입</title>
<link href="css01.css" rel="stylesheet" type="text/css">
 <style>
body
{background-color:#CDF3F3;}
</style>
</head>
<body>
<div id="parent">
<div id="inputPro">

<p style="color:#4AABFC"><%=str %></p>
<style type="text/css"> 
a { text-decoration:none } 
</style>
 <A href="loginForm.jsp"><font size="6">로그인</font></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
 <A href="inputForm.jsp"><font size="6">돌아가기</font></A>
</div>
</div>
</body>
</html>