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

jsp连接sql2000 出了什么问题
org.apache.jasper.JasperException:   Exception   in   JSP:   /testsqlserver.jsp:11

8:   <title> Insert   title   here </title>
9:   </head>
10:   <body>
11:   <%Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver ").newInstance();  
12:   String   url= "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Student ";  
13:   //pubs为你的数据库的  
14:   String   user= "sa ";  


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:371)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root   cause  

javax.servlet.ServletException:   com.microsoft.jdbc.sqlserver.SQLServerDriver
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.testsqlserver_jsp._jspService(testsqlserver_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root   cause  

java.lang.ClassNotFoundException:   com.microsoft.jdbc.sqlserver.SQLServerDriver
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
java.lang.Class.forName0(Native   Method)
java.lang.Class.forName(Class.java:164)
org.apache.jsp.testsqlserver_jsp._jspService(testsqlserver_jsp.java:52)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/5.5.23   logs.



------解决方案--------------------
看testsqlserver_jsp.java文件5