<%@ 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("password");
      
      
   String str="";
   int check=0;
   try{
	   
	   Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","yoon","1234");
		PreparedStatement pstmt=conn.prepareStatement("select  id, passwd from o_member ");
		
		if(check==1){
			Cookie cookie=new Cookie("id",id);
			cookie.setMaxAge(20*60);
			response.addCookie(cookie);
			response.sendRedirect("inputTest.jsp");
			
		}else if(check==0){%>
		
		 
	 <script>alert( "비밀번호가 맞지 않습니다");
		history.go(-1);
		</script>
		
		<% } else{ %>
		<script>alert("아이디가 맞지 않습니다");
		history.go(-1)
		</script>
		
	 <% } catch(Exception e){
		e.printStrackTrace();
		
		} %>
	}
} 
 
	   
   
