<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ 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 num = request.getParameter("num"); 
      
   String str="";
   
   try{
	 
	   Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20182233","991227");
		PreparedStatement pstmt=conn.prepareStatement("insert into o_member(id,password,name,num) values(?,?,?,?)");
		pstmt.setString(1, id);
		pstmt.setString(2, password);
		pstmt.setString(3, name);
		pstmt.setString(4, num);
		
		pstmt.executeUpdate();
		pstmt.close();
		conn.close();  
	 	 
 	 str= "회원 가입이 완료되었습니다.";
 	}catch(Exception e){ 
 		e.printStackTrace();
 		str="회원 가입에 실패했습니다.";
	
 	}
%>

<html>

<head>
<title>회원 가입</title>
</head>

<body>

<form method="post">

<table width = "350" align = "center" style="border-collapse:collapse;">

<tr>
<td>
<div style="font-size:25px; text-align:center; color:#346E73; padding:5px;">
<%=str %>
</div> <br>
</td>
</tr>

<tr>
<td><div style="font-size:15px; text-align:center; color:gray; padding:5px;">이용하실 서비스를 선택해주세요.</div></td>
</tr>

<tr>
<td style="border:1px solid;">
<div style="font-size:17px; text-align:center; padding:5px;">
<A href="http://localhost:8080/PSY/Fin/list.jsp">회원 정보 목록</A>
</div>
</td>
</tr>

<tr>
<td style="border:1px solid;">
<div style="font-size:17px; text-align:center; padding:5px;">
<A href="http://localhost:8080/PSY/Fin/loginForm.jsp">로그인</A>
</div>
</td>
</tr>

</table>

</form>
</body>
</html>