mysql与tomcat连接中遇到的问题
我刚开始学JSP,从别人那里弄来个源程序,服务器用的是tomcat6.16,数据库用的是mysql5.0,开始不知道怎样连接,后来从网上查了些资料,用JDBC5.08连接,但是弄了几天就是打不开,浏览器上显示如下,麻烦高手指点一下 HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
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 /corrision/conn/conn.jsp at line 14
11: String dbUrl="jdbc:mysql://localhost:3306/OA?useUnicode=true&characterEncoding=GBK";
12: String dbUser="root";
13: String dbPwd="123456";
14: con=java.sql.DriverManager.getConnection(dbUrl,dbUser,dbPwd);
15: stmt=con.createStatement();
16: %>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
javax.servlet.ServletException: com.mysql. Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **