Mysql JDBC Connection Error in Eclipse

-2

I am trying to connect the mysql database from my JAVA application. But I get this message:

  

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 31

28:     String action="";
29:     
30:         String url = "jdbc:mysql://localhost:3606/crudjsp;create=true";
31:         Class.forName("com.mysql.jdbc.Driver"); 
32:         
33:         Connection conn = DriverManager.getConnection(url,"root"," ");
34:         Statement stmt = conn.createStatement();

Environment image:

    
asked by anonymous 16.06.2017 / 20:41

1 answer

0

I solved the problem by inserting the .jar of mysql into the classpath and putting port 3306 in the code.

    
16.06.2017 / 21:31