0
我已经完成了在新环境中设置MySql所需的一切,我总是成功地将它转移到另一台PC。但现在有一个错误,该错误表示:通过JSP连接到MySql时出错
HTTP Status 500 - An exception occurred processing JSP page /include/database.jsp at line 4
--------------------------------------------------------------------------------
type Exception report
message An exception occurred processing JSP page /include/database.jsp at line 4
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 /include/database.jsp at line 4
1: <%@ page import="java.sql.*;" %>
2:
3: <%
4: Connection con=DriverManager.getConnection("jdbc:mysql://localhost/bms", "root","");
5:
6: Statement stmt=con.createStatement();
7: Statement stmt1=con.createStatement();
This is the whole code:
<%@ page import="java.sql.*;" %>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost/bms", "root","");
Statement stmt=con.createStatement();
Statement stmt1=con.createStatement();
Statement stmt2=con.createStatement();
Statement stmt3=con.createStatement();
Statement stmt4=con.createStatement();
Statement stmt5=con.createStatement();
ResultSet rs,rs1,rs2,rs3,rs4,rs5;
PreparedStatement pstmt,pstmt1,pstmt2,pstmt3,pstmt4,pstmt5;
%>
你有更多的堆栈跟踪共享? –
请学习使用servlet。 :-) –
删除;从进口 – Leo