<%@ 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 pwd=request.getParameter("pwd");
  String str="";

try{
   Class.forName("oracle.jdbc.driver.OracleDriver");//jdbc 드라이버 load
   Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162499","980202");
    PreparedStatement pstmt=conn.prepareStatement("select * from member");
    ResultSet rs=pstmt.executeQuery();
while(rs.next()){             
if(id.equals(rs.getString("id")) && pwd.equals(rs.getString("password"))){
	session.setAttribute("id",id);
	session.setAttribute("pwd",pwd);
	response.sendRedirect("main.jsp");
}

else{
	str="회원인지 다시 확인해주세여.";
}}}catch(Exception e){
	e.printStackTrace();
}

             
	 %>
	 
<!DOCTYPE html>
<html>
<head>
<meta  http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="member.css" rel="stylesheet" type="text/css">
<title></title>
</head>
<body>
<div id="web">
 <div class="top">
 <div class="top_space">
 <div class="top_manu">
 <ul>
 <li>
 <a href="main.jsp"> 
 <span class="homeIcon"></span>메인페이지</a>
    </li>
    <li>
    <a href="loginForm.jsp">
    <span class="loginIcon"></span>로그인</a>
    </li>
    <li>

 <a href="memberForm.jsp"><span class="signIcon"></span>회원가입</a>
 </li>
 </ul>
 </div></div><hr style="border:solid 0.7px #BDBDBD;"></div>

 
  <main id="main">
  <div class="main_bgspace1">
 <div class="main_bgsize1">
  <div class="main_loginbg">
  </div>
 </div>
 </div>
   <div class="main_tablespace">
 <div class="main_tablesize">
  <div class="main_table ">
<table border="0" width="500" height="180"  align="center" cellspacing="0" >
<tr><td ><%=str %></td></tr>
<tr><td><br><input type="button" class="btn2" value="돌아가기" style="height:60px; width:500px;" onclick="location.href='loginForm.jsp'"></td></tr>
<tr><td><br><input type="button" class="btn2" value="회원가입 " style="height:60px; width:500px;" onclick="location.href='memberForm.jsp'"></td></tr>
</table>
 </div>
 </div>
 </div>
 </main>
 <bottom id="bottom">
 </bottom>
 </div>
</html>