I am trying to get rows from a MySQL table with JSP in Eclipse. My Tomcat server is started, jConnector is in JRE Library and my code is:
import java.sql.Connection;
import java.sql.DriverManager;
public class DBConnection {
    public Connection getDBConnection() throws Exception{
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        Connection  conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","myuname","mypass");
        return conn;
    }
}
JSP is :
<jsp:useBean id="dbConn" scope="request" class="dbConn.DBConnection"/>
<%
  Connection conn=dbConn.getDBConnection();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select * from user");
%>
<html>
...
<body>
<%while (rs.next()){ %>
<h1><%=rs.getString(2) %></h1>
<%} %>
</body>
</html>
<%
  if(conn!=null)
    conn.close();
%>
And final result is
error: root cause
javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
 
     
    