I am trying to connect JSP with MYSQL Server 5.1.49 using TOMCAT 6.0. I am able to connect JAVA with MYSQL but unable to configure mysql with tomcate and getting below error
org.apache.jasper.JasperException: Unable to compile class for JSP: 
An error occurred at line: 54 in the jsp file: /checlLogin.jsp
nme cannot be resolved
51:     String pwd = request.getParameter("password");
52:     String uName = request.getParameter("username");
53: 
54:      if(nme.equals(uName))
55:       {
56:         response.sendRedirect("index.jsp");
57:       }
Stacktrace:
 org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
 org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
 org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
 org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Can anyone kindly explain what I am doing wrong.
Update: Here is my Code: CheckLogin.jsp
<%@ page language="java" import="java.sql.*" errorPage=""%>
<%@ page import="java.util.*"%>
<%
   Connection con = null;
   try {
   Class.forName("com.mysql.jdbc.Driver").newInstance();
   con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "sohail");
   if(!con.isClosed())
   System.out.println("Successfully connected to MySQL server...");
//Step 5: create Statement
Statement st = con.createStatement();
//Step 6: preapare & execute the query
String sql = "SELECT * FROM login";
ResultSet rs = st.executeQuery(sql);
//Step 7: process the results
while(rs.next())
{
String nme = rs.getString("loginID");
String pwd = rs.getString("password");
System.out.println(nme + " " + pwd);
}
//Step 8: close the connection
con.close();
} 
catch(Exception e) 
{
System.err.println("Exception: " + e.getMessage());
} 
finally 
{
try 
{
if(con != null)
con.close();
} 
catch(SQLException e) 
{
} 
}
    String pwd = request.getParameter("password");
    String uName = request.getParameter("username");
     if(nme.equals(uName))
      {
        response.sendRedirect("index.jsp");
      }
      else{
     response.sendRedirect("index.jsp");
      }
%>
Thanks for your further explaination to fix this issue.
 
     
    