Hi. I'm using Netbeans 6.7.1, Apache Tomcat 6.0.20 and MySQL 5.1. Tomcat with Netbeans works great. The Connection /J driver to make work MySQL with Tomcat seems to be working fine too, because this line:
Code:
Class.forName("com.mysql.jdbc.Driver").newInstance();
doesn't give an error. The one that does, however, is:
Code:
Connection c;
Netbeans says that it cannot find symbol class Connection from class Simplifed JSPServlet. When I try to run this app, it shows this error:
Code:
C:\Documents and Settings\Sauronnikko\Mis documentos\NetBeansProjects\WebApplication2\build\generated\src\org\apache\jsp\prueba_jsp.java:68: cannot find symbol
symbol : class Connection
location: class org.apache.jsp.prueba_jsp
Connection c;
^
1 error
C:\Documents and Settings\Sauronnikko\Mis documentos\NetBeansProjects\WebApplication2\nbproject\build-impl.xml:472: The following error occurred while executing this line:
C:\Documents and Settings\Sauronnikko\Mis documentos\NetBeansProjects\WebApplication2\nbproject\build-impl.xml:224: Compile failed; see the compiler error output for details.
It does not recognize "Connection", but this word should be. Here it's the complete code:
Code:
<%@page contentType="text/html" pageEncoding="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>JSP Page</title>
</head>
<body>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection c;
%>
</body>
</html>
Any thougts? Thanks