executeUpdate() is not working........ Need Solution.....please help,....
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ String a=request.getParameter("Name"); String b=request.getParameter("DOB"); String c=request.getParameter("Email"); String d=request.getParameter("Contact"); String e=request.getParameter("Address"); registrationbean r=new registrationbean(); r.setName(a); r.setDOB(b); r.setEmail(c); r.setContact(d); r.setAddress(e); out.print("1"); Class.forName("com.mysql.jdbc.Driver"); out.print("2"); Connection con= DriverManager.getConnection("jdbc:mysql:///mvc","root",""); out.print("3"); String q="insert into login (Name,DOB,Email,Contact,Password) values ('"+a+"','"+b+"','"+c+"','"+d+"','"+e+"');"; out.print("4"); Statement rs=con.prepareStatement(q); /* rs.setString(1,r.getName()); rs.setString(2,r.getDOB()); rs.setString(3,r.getEmail()); rs.setInt(4,r.getContact()); rs.setString(5,r.getAddress()); */ out.print("5"); rs.executeUpdate(q); out.print("6"); } catch(Exception e) { } } }