连接数据库出错???

07-06-11 heguangwen8

请问以下是什么问题??

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:11

8: String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=webPurchase";

9: String user="wond";

10: String password="123456";

11: Connection conn= DriverManager.getConnection(url,user,password);

12: %>

13: Now time is: <%=new java.util.Date()%>

14: </body>

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: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)

org.apache.jsp.index_jsp._jspService(index_jsp.java:66)

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)

shirocyy
2007-08-06 11:23

这是因为没有加载驱动

raulliran
2007-08-06 11:40

javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket

==============================================================

你的驱动加载不成功

看看是不是你的环境的问题

有没有把驱动复制到正确的路径上

书写是否正确等