<%@ 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>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body bgcolor="#aee19b" style="text-align:center;">
<jsp:include page="Head.jsp" />
<%
String a = (String)session.getAttribute("id");

String id ;
String password;
String name;
String ymd;
String email;
String job;

ResultSet rs=null;
try{
	Class.forName("oracle.jdbc.driver.OracleDriver");  //oracle드라이버 로드
    Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162511","971204");
    PreparedStatement pstmt=conn.prepareStatement("select * from member where id=?");
    pstmt.setString(1, a);
    rs=pstmt.executeQuery();
    while(rs.next()) { //DB를 일일이 확인 할 것 없이 바로 자신의 회원정보를 열람 할 수 있도록 하였다.
        %>        
        <center>
        <h2>나의 회원정보</h2>
        <table border ="1" align="center">
            <tr>
                    <td>아이디:</td><td><%=rs.getString("id") %></td>
            </tr>
            <tr>
                <td>이름:</td><td><%=rs.getString("name")%></td>
            </tr>
            
            <tr>
                <td>생년월일:</td><td><%=rs.getString("ymd") %></td>
            </tr>
            <tr>
                <td>이메일:</td><td><%=rs.getString("email") %></td>
            </tr>
            <tr>
                <td>직업:</td><td><%=rs.getString("job") %></td>
            </tr>
        </table>
        
    <%
    
    }

}catch(Exception e){
	e.printStackTrace();
}


%>
 <br>
    <a href="main.jsp?contentPage=Update.jsp" align = "center">정보수정</a> 


</body>
</html>