<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
        <%@ 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("EUC-KR");%>
    <%
    String id = request.getParameter("id");
    String password = request.getParameter("password");
    
    String str = "";
    
    try{
	
	Class.forName("oracle.jdbc.driver.OracleDriver");
	Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162513","970709");
	PreparedStatement pstmt=conn.prepareStatement("select * from member_20190514");
	ResultSet rs=pstmt.executeQuery();
	
	while(rs.next()) {
		if (id.equals(rs.getString("id")) && password.equals(rs.getString("password"))) {
			
			session.setAttribute("id",id);
			session.setAttribute("password",password);
			response.sendRedirect("main.jsp");
			
		} else {
			str="실패했습니다. 회원인지 다시 확인해 주세요";
		}
	}
}catch(Exception e){
	e.printStackTrace();

}
%>