求解决,jsp连接数据库报错
HTTP Status 500 - An exception occurred processing JSP page /index.jsp at line 63type Exception report
message An exception occurred processing JSP page /index.jsp at line 63
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 63
60: String password = "sa";
61: String url="jdbc:sqlserver://localhost:1433;DatabaseName="+dateBaseName;
62:
63: Connection conn=DriverManager.getConnection(url,username,password);
64:
65: System.out.println("鏁版嵁搴撹繛鎺�锛�);
66:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:567)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:454)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://localhost:1433;DatabaseName=School
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:908)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:837)
org.apache.jsp.index_jsp._jspService(index_jsp.java:176)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:431)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
[ 本帖最后由 yh612510 于 2015-5-7 14:02 编辑 ]