<%@ 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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>회원정보</h2>
	<table border="1">
		<tr>
			<td width=100><b>아이디</b></td>
			<td width=100><b>패스워드</b></td> 
			<td width=100><b>이름</b></td>
			<td width=100><b>성별</b></td>
			<td width=100><b>이메일</b></td> 
			<td width=100><b>휴대전화</b></td>
			<td width=100><b>주소</b></td>    
		</tr>
		<%
		Connection conn=null;
		PreparedStatement pstmt=null;
		ResultSet rs=null;
		
		  try{
			 
			  String dbId="jspid";
			  String dbPassword="jsppassword";
			  String dbName="jspname";
			  String dbGender="jspgender";
			  String dbEmail="jspemail";
			  String dbPhone="jspphone";
			  String dbAddress="jspaddress";
			 
			  Class.forName("oracle.jdbc.driver.OracleDriver");
				 conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl", "20172262", "980930");
				 pstmt=conn.prepareStatement("select * from member_fin");
				 rs = pstmt.executeQuery();
			  
			  
			  while(rs.next()){
				  String id = rs.getString("id");
				  String password = rs.getString("password");
				  String name = rs.getString("name");
				  String gender = rs.getString("gender");
				  String email = rs.getString("email");
				  String phone = rs.getString("phone");
				  String address = rs.getString("address");
		  
		%>
		<tr>
			<td width=100><%=id %></td>
			<td width=100><%=password %></td> 
			<td width=100><%=name %></td>
			<td width=100><%=gender %></td>
			<td width=100><%=email %></td> 
			<td width=100><%=phone %></td> 
			<td width=100><%=address %></td>
		</tr>
		<%}
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			if(rs !=null)try{rs.close();}catch(SQLException sqle){}
			if(pstmt !=null)try{pstmt.close();}catch(SQLException sqle){}
			if(conn !=null)try{conn.close();}catch(SQLException sqle){}
		}
		%>  
	</table>
	<form method="post" action="loginForm.jsp">
	<input type="submit" value="돌아가기">
	</form>
</body>
</html>