<%@ 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("pass");
String NAME = request.getParameter("name");
String HOP = request.getParameter("hop");
String HOME = request.getParameter("home");
String SCHOOL = request.getParameter("school");

String str="";


try{
	Class.forName("oracle.jdbc.driver.OracleDriver");
	Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20172304","981116");
	PreparedStatement pstmt=conn.prepareStatement("insert into O_TABLE01(ID,PASSWD,NAME,HOP,HOME,SCHOOL) values(?,?,?,?,?,?)");
	pstmt.setString(1, ID);
	pstmt.setString(2, PASSWD);
	pstmt.setString(3, NAME);
	pstmt.setString(4, HOP);
	pstmt.setString(5, HOME);
	pstmt.setString(6, SCHOOL);
	
	pstmt.executeUpdate();
	pstmt.close();
	conn.close();
	%>
	<b><%=NAME %></b>님 가입을 축하드립니다.
	<%
}
catch(Exception e){
	e.printStackTrace();
	%>
	<b><%=NAME %></b>님의 가입이 실패하였습니다.
	<%
}
	
%>	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>



</body>
</html>