<%@ 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> 
		</tr>
		<%
		Connection conn=null;
		PreparedStatement pstmt=null;
		ResultSet rs=null;
		
		  try{
			 
			  String dbId="jspid";
			  String dbPassword="jsppassword";
			  String dbName="jspname";
			 
			  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");
			  
		  
		%>
		<tr>
			<td width=100><%=id %></td>
			<td width=100><%=password %></td> 
			<td width=100><%=name %></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>
</body>
</html>