i hav a task to connect jsp to oracel database using preparestatement and gettin an error showin dat prepared statement obj cant be created pstmt is nt resloved here are the files
index.jsp
<!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=ISO-8859-1"> <script language="JavaScript" type="text/JavaScript"> function validateForm() { var x=document.forms["myForm"]["Login"].value; if (x==null || x=="") { alert("Login must be filled out"); return false; } } </script> </head> <body bgcolor=pink> <center><h1>DiggIn</h1> <p><b>Welcome to DiggIn</b> </p> <form action="Display.jsp" method="post"> <table width="276" height="74" border="0"> <tr> <td width="60" height="53">Login</td> <td>:</td> <td width="199"><input type="text" name="Login" /></td> </tr> <tr> <td width="60" height="42">Password</td> <td>:</td> <td><input type="password" name="Password" /></td> </tr> <tr> <td width="60" height="42">Qualification</td> <td>:</td> <td><input type="text" name="Qualification" /></td> </tr> <tr> <td width="60" height="42">City</td> <td>:</td> <td><input type="text" name="City" /></td> </tr> </table><form action=""><input type="submit" value="SignUp!"></form> <form action=""><input type="button" name="SignIn" value="SignIn" /></form> </center> </form> </body> </html> Display.jsp <html> <head> </head> <%@ page import="java.sql.*"%> <body bgcolor="aqua"> <center> <% try{ Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","abc"); PreparedStatement pstmt=null; String SQL="Insert into Login values(?,?,?,?)"; pstmt=con.prepareStatement(SQL); } catch(Exception e){ e.printStackTrace(); } String Login=request.getParameter("Login"); String Password=request.getParameter("Password"); String Qualification=request.getParameter("Qualification"); String City=request.getParameter("City"); out.println(Login); out.println(Password); out.println(Qualification); out.println(City); pstmt.setString(1,Login); pstmt.setString(2,Password); pstmt.setString(3,Qualification); pstmt.setString(4,City); String result=pstmt.executeUpdate(); %> <a href="user.html">Update</a> </center> </body> </html> Error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 26 in the jsp file: /Display.jsp pstmt cannot be resolved 23: out.println(Password); 24: out.println(Qualification); 25: out.println(City); 26: pstmt.setString(1,Login); 27: pstmt.setString(2,Password); 28: pstmt.setString(3,Qualification); 29: pstmt.setString(4,City); An error occurred at line: 27 in the jsp file: /Display.jsp pstmt cannot be resolved 24: out.println(Qualification); 25: out.println(City); 26: pstmt.setString(1,Login); 27: pstmt.setString(2,Password); 28: pstmt.setString(3,Qualification); 29: pstmt.setString(4,City); 30: String result=pstmt.executeUpdate(); An error occurred at line: 28 in the jsp file: /Display.jsp pstmt cannot be resolved 25: out.println(City); 26: pstmt.setString(1,Login); 27: pstmt.setString(2,Password); 28: pstmt.setString(3,Qualification); 29: pstmt.setString(4,City); 30: String result=pstmt.executeUpdate(); 31: %> An error occurred at line: 29 in the jsp file: /Display.jsp pstmt cannot be resolved 26: pstmt.setString(1,Login); 27: pstmt.setString(2,Password); 28: pstmt.setString(3,Qualification); 29: pstmt.setString(4,City); 30: String result=pstmt.executeUpdate(); 31: %> 32: <a href="user.html">Update</a> An error occurred at line: 30 in the jsp file: /Display.jsp pstmt cannot be resolved 27: pstmt.setString(2,Password); 28: pstmt.setString(3,Qualification); 29: pstmt.setString(4,City); 30: String result=pstmt.executeUpdate(); 31: %> 32: <a href="user.html">Update</a> 33: </center> 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)