Regdata
Regdata
Regdata
reg;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*/
@WebServlet("/regdata")
/**
* @see HttpServlet#HttpServlet()
*/
public regdata() {
super();
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
/**
*/
try {
// Database credentials
System.out.println("hi");
Class.forName(JDBC_DRIVER);
stmt.setString(1, request.getParameter("n1"));
stmt.setString(2, request.getParameter("un1"));
stmt.setString(3, request.getParameter("pass"));
stmt.setString(4,request.getParameter("mno1"));
stmt.executeUpdate();
request.getRequestDispatcher("login.jsp").forward(request, response);
catch(Exception e)
System.out.println("wrong");
e.printStackTrace();