0
我無法使用JSP頁面連接到MySql。這是我的連接查詢 -嘗試使用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;