标题:求解决,jsp连接数据库报错
只看楼主
yh612510
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-5-7
 问题点数:0 回复次数:2 
求解决,jsp连接数据库报错
HTTP Status 500 - An exception occurred processing JSP page /index.jsp at line 63

type 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 编辑 ]
搜索更多相关主题的帖子: occurred password sqlserver 连接数据库 localhost 
2015-05-07 14:00
qwe885167759
Rank: 4
等 级:业余侠客
威 望:5
帖 子:148
专家分:259
注 册:2013-3-12
得分:0 
检查一下你的加载SQL驱动的语语句正确不,然后看一下连接SQL
的jar包有没有放到相应的位置,如果还不行,你看下是不是jar包的版本不对,下载一个正确的版本。

我本楚狂人,凤歌笑孔丘
2015-06-05 15:20
yzeniu
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2015-7-22
得分:0 
回复 楼主 yh612510
报错500的问题解决没,我也碰到了同样的问题,我们互相交流
2015-07-22 15:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-444960-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017868 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved