Mam taki oto kod:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<title>Copyright artim</title>
</head>
<body>
<br><br><br><br>
<%@ page language="java" import="java.sql.*, java.io.*, javax.servlet.http.*" %>
<%
Connection con = null;
String url ="jdbc:mysql://zs4.no-ip.org:3306/student";
try {
Class.forName("org.gjt.mm.mysql.Driver");{
con = DriverManager.getConnection(url,"student","student");
Statement statement = con.createStatement();
} } catch (IOException ioe) {
out.println(ioe.getMessage());
} catch (SQLException sqle) {
out.println(sqle.getMessage());
} catch (Exception e) {
out.println(e.getMessage());
} finally {
try {
if ( con != null ) {
con.close();
}
} catch (SQLException sqle) {
out.println(sqle.getMessage());
}
}
%>
</body>
</html>
I dostaję komunikat o błędzie:
exception java.io.IOException is never thrown in body of corresponding try statement
} catch (IOException ioe) {
^
1 error
Jak się go pozbyć ?