-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();
Put the whole stacktrace in the question
– rray
You added the mysql driver to classpath?
– user28595
No! Only in the project. As shown in the image.
– alexjosesilva
Take a look if this reply help you.
– josivan
I received this message: HTTP Status 500 - An Exception occurred Processing JSP page /index.jsp at line 33 type Exception report message An Exception occurred Processing JSP page /index.jsp at line 33 Description The server encountered an Internal error that prevented it from fulfilling this request. Exception org.apache.Jasper.Jasperexception: An Exception occurred Processing JSP page /index.jsp at line 33 30: String url = "jdbc:mysql:/localhost/crudjsp"; 31: Class.forName("com.mysql.jdbc.Driver"); 32: 33: Connection Conn = Drivermanager.getConnection(url,"root"," ");
– alexjosesilva
If you do not add in the classpath you will not recognize the driver. Right-click the jar and select
add to build classpath
– user28595
I’m using the NEON eclipse. You don’t have this option!
– alexjosesilva
I also use neon eclipse and have this option yes. Hover over option
build path
that she appears in the submenu.– user28595
However, I was able to insert into Classpath
– alexjosesilva
HTTP Status 500 - An Exception occurred Processing JSP page /index.jsp at line 33
– alexjosesilva