<%@ page import="java.sql.*" %>
<% String uname=request.getParameter("n");
String pwd=request.getParameter("pwd");
String country=request.getParameter("cnt");
try{
Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/my_db","root","");
Statement st = conn.createStatement();
int i=st.executeUpdate("insert into test values('"+uname+"','"+pwd+"','"+country+"')");
out.println("Registration Successful");
}
catch(Exception e)
{
out.println(e);
}
%>
this is code for jdbc connection with database .i am facing error com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: even i have installed mysql 8 version