<jsp:include page="menu.jsp"></jsp:include><html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
            
</head>
<body bgcolor=bisque>

    
    
    
<%@page language="java" import="java.util.*,java.sql.*,javax.swing.* ,java.lang.* " contentType="text/html"%>


<%            
	      
               String b=request.getParameter("uname");
               String c=request.getParameter("pwd");
               String c1=request.getParameter("post");
               String c2=request.getParameter("dob");
               String c3=request.getParameter("div");
               
              
               try
              {
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           
               Connection con=DriverManager.getConnection("jdbc:odbc:sree","sree","sree");
               PreparedStatement pstmt = con.prepareStatement("insert into us values(?,?,?,?,?)");
              //pstmt.setInt(1, a);
              pstmt.setString(1, b);
              pstmt.setString(2, c);
              pstmt.setString(3,c2);
              pstmt.setString(5,c3);
              pstmt.setString(4,c1);
             
              int x=pstmt.executeUpdate();
              if(x==1)
                  {
                  request.setAttribute("sri","<h3>The question was successfully inserted" );
                  
                  //request.setAttribute("x" , "The insertion was failed");
                  RequestDispatcher dispatch=request.getRequestDispatcher("reg.jsp");
                  dispatch.forward(request,response);
              }
              else
                {
                  request.setAttribute("sri","<h3>The question was not inserted" );
                  
                  //request.setAttribute("x" , "The insertion was failed");
                  RequestDispatcher dispatch=request.getRequestDispatcher("reg.jsp");
                  dispatch.forward(request,response);
                }
              
            }
catch(SQLException e)
{
    out.println(e);
    
}                              
              
%>  
   
</body>
</html>