problem is not in the code, but you don’t have added the driver to your project!!!
You have to add the *.jar
driver to your project…
Try putting this in your lib directory, then re-starting tomcat…
problem is Class.forName("com.mysql.jdbc.Driver");
it tries to load the driver, but it is not getting it, this is the reason you are getting:
java.lang.ClassNotFoundException.