View RSS Feed

Angad Kumar Shukla's blog

How To Insert Data Into Table Using JSP?

Rating: 4 votes, 2.25 average.
Click image for larger version. 

Name:	image.jpg 
Views:	12515 
Size:	14.0 KB 
ID:	191
HTML file:

    <center>INSERT INTO TABLE</center>

<body bgcolor="bisque" text="green">

    <form name="f" method="post" action="5.jsp">

    Enter the name:   <input type="text" name="n1"><br><br>

     Enter the roll no:   <input type="text" name="n2"><br><br>

       Enter the marks:   <input type="text" name="n3">
    <input type="submit" value="insert">



JSP file:


    <%@page language="java"%>
    <%@page import="java.sql.*"%>


        String s1=request.getParameter("n1");
        int s2=Integer.parseInt(request.getParameter("n2"));
        int s3=Integer.parseInt(request.getParameter("n3"));

        PreparedStatement ps=null;
        Connection cn=null;
        ps=cn.prepareStatement("insert into student1 values(?,?,?)");
        out.println("insertion done");



Submit "How To Insert Data Into Table Using JSP?" to Digg Submit "How To Insert Data Into Table Using JSP?" to del.icio.us Submit "How To Insert Data Into Table Using JSP?" to StumbleUpon Submit "How To Insert Data Into Table Using JSP?" to Google


  1. chikoo's Avatar
    nicely done. clear cut. liked it.

Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.