日期:2014-05-18  浏览次数:20833 次

jsp连接sql server数据库报错
org.apache.jasper.JasperException:   com.microsoft.jdbc.sqlserver.SQLServerDriver
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root   cause  

javax.servlet.ServletException:   com.microsoft.jdbc.sqlserver.SQLServerDriver
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.link_jsp._jspService(org.apache.jsp.link_jsp:120)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root   cause  

java.lang.ClassNotFoundException:   com.microsoft.jdbc.sqlserver.SQLServerDriver
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:127)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
java.lang.ClassLoader.loadClassInternal(Unknown   Source)
java.lang.Class.forName0(Native   Method)
java.lang.Class.forName(Unknown   Source)
org.apache.jsp.link_jsp._jspService(org.apache.jsp.link_jsp:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

应该怎么改呀?
我的连接代码是:
<%@   page   language= "java "   import= "java.util.*,java.sql.* "   pageEncoding= "GB2312 "%>
<%
String   path   =   request.getContextPath();
String   basePath   =   request.getScheme()+ ":// "+request.getServerName()+ ": "+request.getServerPort()+path+ "/ ";
%>

<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN ">
<html>
    <head>
        <base   href= " <%=basePath%> ">
       
        <title> My   JSP   'lin