KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When I use the follow code in eclipse Dynamic Web Project inside servlet , like this : @WebServlet("/CreateCustomerServlet") public class CreateCustomerServlet extends HttpServlet { private static final long serialVersionUID = 1L; private void test() throws SQLException, ClassNotFoundException { // use the JAR ... Class.forName("com.mysql.jdbc.Driver");//here the exception } } it throw the exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in the line: Class.forName("com.mysql.jdbc.Driver"); In the Build path of the dynamic web project I added the jar: mysql-connector-java-5.1.21-bin.jar I add snapshot of the folder , you can see where it is the required jar -
Tags (comma-separated)
Save Edits
Cancel