Reputation: 3
I know there are many many threads on this problem but none of these solutions fix my issue. I have added the necessary .jar file to the WEB-INF-lib folder and i still get the error. I tried directly adding the .jar file to the build path, and i still get the same error. Can anyone help me out on this! I've been playing around with this issue for a couple days now to no avail.
Here's my code:
<%@ page import = "java.sql.*" %><%@ page import = "java.io.*" %><%@ page import = "com.mysql.*" %><?xml version ="1.0" ?>
<tours>
<%
Connection connection = null;
Statement staement = null;
ResultSet result = null;
try{
Class.forName("com.mySQL.jdbc.Driver").newInstance();
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/tours", "root", "root");
out.println("connected to database");
}
catch(SQLException e){
out.println("error connecting to database");
}
%>
Upvotes: 0
Views: 116
Reputation: 21961
You have wrong package name of MySQL driver class. Change from
com.mySQL.jdbc.Driver
to
com.mysql.jdbc.Driver
Upvotes: 3