<%@ 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"); %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
 <%
 String id = request.getParameter("id");
 String pwd = request.getParameter("pwd");
 String sql="";
 String delsql="";
 ResultSet rs=null;
 String str="";
 
 try{
	 Class.forName("oracle.jdbc.driver.OracleDriver");
	 Connection con=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20172304","98116");
	 sql="select id from O_MEMBER where ID=?";
	 PreparedStatement pstmt=con.prepareStatement(sql);
	 pstmt.setString(1, id);
	 rs=pstmt.executeQuery();
	 
	 if(rs.next()){
		 String rid=rs.getString("id");
		 
		 if(id.equals(rid)){
			 delsql="delete from O_MEMBER where ID=?";
			 pstmt=con.prepareStatement(delsql);
			 pstmt.setString(1, id);
			 pstmt.executeUpdate();
		 }
	 }
	 
	 
 		rs.close();
 		pstmt.close();
 		con.close();
 
 		str="O_MEMBER table 에서 byebye ..";
	 
	 
 
 
 }catch(Exception e){
		 e.printStackTrace();
		 str="O_MEMBER 테이블에 새로운 레코드 삭제에 실패했습니다.";
	 }
 
 
 
 
 %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%=str %><p>

<A href="http://Localhost:8080/S20172304_0528/LOGIN/list.jsp">click me!</A>

</body>
</html>