I have the following code in which i'm getting class not found exception of com. mysql.jdbc.Driver. what should i do ?
try {
String name = request.getParameter("name");
String pass = request.getParameter("pass");
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dimple?zeroDateTimeBehavior=convertToNull", "root", "password");
PreparedStatement ps = con.prepareStatement("Insert Into data Values(? ,? )");
ps.setString(1, name);
ps.setString(2, pass);
int f = ps.executeUpdate();
if(f>0)
{
out.println("Successfuly inserted");
RequestDispatcher rd = request.getRequestDispatcher("index.html");
rd.forward(request, response);
}
else
out.println("Not inserted");
}
catch(Exception e)
{
out.println(e);
}