<%@ 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" %>
 <%@ page session = "true" %>

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

<% 
   String id = request.getParameter("id");
   String passwd= request.getParameter("password");
   String name = request.getParameter("name");    
      
   String str="";
   
   try{
	 
	   Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162510","950505");
		PreparedStatement pstmt=conn.prepareStatement("insert into o_member(id,password,name) values(?,?,?)");
		pstmt.setString(1, id);
		pstmt.setString(2, passwd);
		pstmt.setString(3, name);
		
		pstmt.executeUpdate();
		pstmt.close();
		conn.close();  
	 	 
 	 str= "회원가입 완료!.";
 	}catch(Exception e){ 
 		e.printStackTrace();
 		str="회원가입 실패!";
	
 	}
 %>
<html>
<head>
<title>회원목록추가</title>
</head>
<body  bgcolor="#FFA7A7" style="text-align : center;">
  <%=str %>  <p>
  
 <A href="list.jsp">회원목록보기 </A>
  
</body>
</html>