<%@ 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=(String)session.getAttribute("id");
String passwd=request.getParameter("passwd");

ResultSet rs=null;

String sql=null;
try{
	 Class.forName("oracle.jdbc.driver.OracleDriver");  //oracle드라이버 로드
	    Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162511","971204");
	   sql="select * from member where id=? ";
	   PreparedStatement pstmt=conn.prepareStatement(sql);
	   pstmt.setString(1, id);
	   
	   rs=pstmt.executeQuery(); //결과 가져옴
	  
	  if(rs.next()){
	  String dbPass=rs.getString("pass");
	  if(passwd.equals(dbPass)){
		  response.sendRedirect("Update-1.jsp");
	  	  }else{
	  		%>
    		<script>
alert("fail");
location.href="main.jsp?contentPage=Updatefir.jsp";
</script>
    		
    		<%
	  	  }
	  }
}catch(Exception e){
e.printStackTrace();
}finally{
}
%>