我无法使用 JSP 页面连接到 MySql。这是我的连接查询 -
<%
String driver = "com.mysql.jdbc.Driver";
Class.forName("Driver").newInstance();
Connection con=null;
ResultSet rst=null;
Statement stmt=null;
con=DriverManager.getConnection("jdbc:mysql://10.1.11.103:3306/jiradb40","opsrptusr", "opsrptusr");
stmt=con.createStatement();
String query = "(select * from jiraissue limit 2)";
%>
我已将 jar 文件放在 lib 文件夹中,但仍然出现错误。
任何帮助都将不胜感激。
异常报告
message An exception occurred processing JSP page /Worklog.jsp at line 5
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 /Worklog.jsp at line 5
2: <%@page import="java.text.DecimalFormat" %>
3: <%
4: String driver = "com.mysql.jdbc.Driver";
5: Class.forName("Driver").newInstance();
6: Connection con=null;
7: ResultSet rst=null;
8: Statement stmt=null;