<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> The Page Information For PhoneBook</title>
</head>
<body>
<h1> PhoneBook Information </h1>
<p>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/peisze", "root", "");
PreparedStatement pr = connection.prepareStatement("SELECT * FROM Phone");
ResultSet re = pr.executeQuery();
%>
</p>
<fieldset>
<legend> PhoneBook </legend>
<table border="1">
<th> Id </th>
<th> Name </th>
<th> Phone </th>
<th> Mobile </th>
<th> email </th>
<th> address </th>
<%
while(re.next())
{
%>
<tr>
<td> <%= re.getString(1)%> </td>
<td> <%= re.getString(2)%> </td>
<td> <%= re.getString(3)%> </td>
<td> <%= re.getString(4)%> </td>
<td> <%= re.getString(5)%> </td>
</tr>
<% } %>
</table>
</fieldset>
</body>
</html>


