<jsp:include page="menu.jsp"></jsp:include><html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="css/sri.css" rel="stylesheet" type="text/css"></link>        
</head>
<body background="images\bg.jpg">

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


<%            
	       int a=Integer.parseInt(request.getParameter("lqno"));
               String b=request.getParameter("lqname");
               String c=request.getParameter("sec");
               
              
               try
{                             
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           
               Connection con=DriverManager.getConnection("jdbc:odbc:sree","sree","sree");
               PreparedStatement pstmt = con.prepareStatement("insert into lqb values(?,?,?)");
               pstmt.setInt(1, a);
               pstmt.setString(2, b);
               pstmt.setString(3, c);
             
              int x=pstmt.executeUpdate();
             if(x==1)
                  {
                  request.setAttribute("sree","The question was successfully inserted" );
                  RequestDispatcher dispatch=request.getRequestDispatcher("linsert.jsp");
                  dispatch.forward(request,response);
              }
              else
                {
                  request.setAttribute("sree","The question was not inserted" );
                  
                  RequestDispatcher dispatch=request.getRequestDispatcher("linsert.jsp");
                  dispatch.forward(request,response);
              }
              
     }
catch(SQLException e)
{
    out.println(e);
    out.println("&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<h1>Try Again</h1>");
}                              
              
%>  
   
</body>
</html>