title: Display table data from mysql to jsp page
body: <p>I have </p>
  
  <pre><code>&lt;%@ page import="com.mysql.*" %&gt;
  &lt;%@ page import="java.sql.*" %&gt;
  
  &lt;html&gt;
  &lt;body&gt;
  &lt;div id="content"&gt;
  
  
      &lt;p&gt;Displaying table contents: &lt;/p&gt;
  
      &lt;table border="0" cellpadding="10"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Id&lt;/th&gt;
                  &lt;th&gt;Name&lt;/th&gt;
                  &lt;th&gt;Company&lt;/th&gt;
                  &lt;th&gt;Salary&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
  
  
              &lt;%
                  Class.forName("com.mysql.jdbc.Driver");
                  Connection conn = null;
                  conn = DriverManager.getConnection("jdbc:mysql://localhost:8080/Connection", "username", "password");
                  Statement stmt = null;
                  stmt = conn.createStatement();
                  String query = "select * from employeee";
                  ResultSet rs = null;
                  rs = stmt.executeQuery(query);
                  while(rs.next()){
              %&gt;
              &lt;tr&gt;
                  &lt;%
                      int id = rs.getInt("id");
                      String name = rs.getString("name");
                      String company = rs.getString("company");
                      int salary = rs.getInt("salary");
                  %&gt;
                  &lt;td&gt;&lt;%=id %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=name %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=company %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%=salary %&gt;&lt;/td&gt;
              &lt;/tr&gt;               
  
              &lt;%      
                  }
              %&gt;
  
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am getting a <code>Class Not Found Exception for com.mysql.jdbc.Driver</code></p>
  
  <p>I have added the external jar to the project and using this same code i get the results in a normal java file. </p>
  
  <p>What is wrong here?</p>