Can't connect to MySQL database from tomcat
Hey, I'm getting this error: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. I'm just trying to connect to the database. With this code <%@page import="java.sql.*"%> <% try{ // Class.forName("com.mysql.jdbc.Driver"); Class.forName("org.gjt.mm.mysql.Driver"); out.println("found"); } catch (ClassNotFoundException ex){ out.println("Erro<br/>"); out.println(ex.toString()); } catch (Exception e){ out.println(e.toString()); } Connection ocon; try{ ocon = DriverManager.getConnection("jdbc