hi am trying to insert and retrieve the data from mysql database

but am getting a error saying SQLException caught: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION

here is my code


retrieve.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>*

<html>
<head>
<title>display data from the table using jsp</title>
</head>
<body>
<br><br><br><br><br><br><br>
<TABLE align="center" style="background-color: #ffffcc;">
<TR>
<TD align="center"><h2>To display all the data from the table click here...</h2></TD>
</TR>
<TR>
<TD align="center"><A HREF="result_info.jsp">
<font size="4" color="blue">show data from table</font></A></TD>
</TR>
</TABLE>
</body>
</html>


result_info.jsp

<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>*


<html>
<body bgcolor="white">
<h style="font-family:arial;color:Black;font-size:10px;">

<%
try {
String connectionURL = "jdbc:mysql://localhost:3306/empLeave";

Connection connection = null;

Statement statement = null;

ResultSet rs = null;

Class.forName("com.mysql.jdbc.Driver").newInstance ();

connection = DriverManager.getConnection(connectionURL, "root", "notallowed");

statement = connection.createStatement();

String QueryString = "SELECT a.pol_letype,a.leaveid,b.name,b.uid,a.frm,a.upto,a .recommby,a.aaname,a.stats from leave_info a,empDetail b";
rs = statement.executeQuery(QueryString);
%>
<table border="1" >
<tr>
<th>LeaveType</th>
<th>ApLeaveNo</th>
<th>EmpName</th>
<th>EmpId</th>
<th>From</th>
<th>&nbsp&nbsp&nbsp&nbsp To &nbsp&nbsp&nbsp&nbsp</th>

<th>Recommend by</th>
<th>Approving Authority</th>
<th>Status</th>
<th>&nbsp</th>
</tr>
<%
while (rs.next()) {
%>
<TR>
<TD><%=rs.getString(1)%></TD>
<TD><%=rs.getString(2)%></TD>
<TD><%=rs.getString(3)%></TD>
<TD><%=rs.getString(4)%></TD>
<TD><%=rs.getString(5)%></TD>
<TD><%=rs.getString(6)%></TD>
<TD><%=rs.getString(7)%></TD>
<TD><%=rs.getString(8)%></TD>
<TD><%=rs.getString(9)%></TD>

</TR>

<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp &nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href="details.html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
<tr>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td> &nbsp </td>
<td>&nbsp</td>
<td>&nbsp</td>
<td><a href=".html" target="frame5">Check/Modify</a></td>
</tr>
</tr>
<% } %>
<%

rs.close();
statement.close();
connection.close();
} catch (Exception ex) {
%>
</font>
<font size="+3" color="red"></b>
<%
out.println("Unable to connect to database.");
}
%>
</table>
</html>


web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>retrieve_info.jsp</welcome-file>
</welcome-file-list>
</web-app>

please help me to resolve this

this is the code to retrieve information