title: how to delete a specific row in the html table and database
body: <p>I wrote a table in html which consists of 6 columns with 6th column as a delete button.The rows will gets updated dynamically.</p>
  
  <p>Now my first question is how to delete a row when we click that rows delete button and even in the database also.</p>
  
  <p>Second question is, there are check boxes with every row and a delete1 button on the top on the table. If I checked some rows in table and click the delete1 button then those records must be deleted in the database.</p>
  
  <p>How can this be done.</p>
  
  <p>The below is my jsp code.</p>
  
  <pre><code>&lt;INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')"/&gt;&lt;br&gt;
  &lt;table id="dataTable" border="15" &gt;
  &lt;tr&gt;&lt;th colspan="6" align="center"&gt;Data&lt;/th&gt;&lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;b&gt;&lt;/b&gt;&lt;/td&gt;   
          &lt;td&gt;&lt;b&gt;Institution Name&lt;/b&gt;&lt;/td&gt;
          &lt;td&gt;&lt;b&gt;Location&lt;/b&gt;&lt;/td&gt;
          &lt;td&gt;&lt;b&gt;Status&lt;/b&gt;&lt;/td&gt;
          &lt;td&gt;&lt;b&gt;Edit&lt;/b&gt;&lt;/td&gt;
          &lt;td&gt;&lt;b&gt;Delete&lt;/b&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;%
      Session ses=new Configuration().configure().buildSessionFactory().openSession();
      Transaction tx=ses.beginTransaction();
      Query q1=ses.createQuery("from RegisterPojo as rp");
      List&lt;Enumeration&gt; l= q1.list();
      for(int i=0; i&lt;l.size();++i) {
          RegisterPojo rp=(RegisterPojo)l.get(i);
          System.out.println(rp.getInstName());
          System.out.println(rp.getInstName());
  %&gt;      
          &lt;tr&gt;
          &lt;td&gt;&lt;input type="checkbox" value="&lt;%= rp.getNo()%&gt;"&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= rp.getInstName()%&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= rp.getLocation()%&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= rp.getStatus()%&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a href="register.jsp"&gt;Edit&lt;/a&gt;&lt;/td&gt; 
          &lt;td&gt;&lt;INPUT type="button" value="Delete"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
  &lt;%
      }
  %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>NOTE: I saw these type of questions in stackoverflow and even in some other websites but they didn't match my case. </p>