title: How to display a database table on to the table in the JSP page
body: <ul>
  <li>My problem is that the table in my database is not able to be displayed at the table in my JSP page. </li>
  <li>I find this code totally right but dont know y m not getting the output right. </li>
  <li><p>Please tell me what is the problem.</p>
  
   
      
          
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"                                                    "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;/body&gt;
  &lt;form method="post"&gt;
  
  &lt;table border="2"&gt;
  &lt;tr&gt;
  &lt;td&gt;ID&lt;/td&gt;
  &lt;td&gt;NAME&lt;/td&gt;
  &lt;td&gt;SKILL&lt;/td&gt;
  &lt;td&gt;ACTION&lt;/td&gt;
  &lt;/tr&gt;
  &lt;%
  try
  {
  Class.forName("com.mysql.jdbc.Driver");
  String url="jdbc:mysql://localhost/test";
  String username="root";
  String password="root";
  String query="select * from jsp1";
  Connection conn=DriverManager.getConnection(url,username,password);
  Statement stmt=conn.createStatement();
  ResultSet rs=stmt.executeQuery(query);
  while(rs.next())
  {
  
  %&gt;
      &lt;tr&gt;&lt;td&gt;&lt;%rs.getInt("ID"); %&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;%rs.getString("NAME"); %&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;&lt;%rs.getString("SKILL"); %&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;%
  
  }
  %&gt;
      &lt;/table&gt;
      &lt;%
      rs.close();
      stmt.close();
      conn.close();
      }
  catch(Exception e)
  {
      e.printStackTrace();
      }
  
  
  
  
  %&gt;
  
  &lt;/form&gt;
  &lt;/html&gt; 
  </code></pre></li>
  </ul>