标题:[求助]JSP连接数据库SQL Server2000问题
只看楼主
changyi5757
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2005-7-31
 问题点数:0 回复次数:2 
[求助]JSP连接数据库SQL Server2000问题

exception

javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
	org.apache.jsp.ch9._1_jsp._jspService(_1_jsp.java:86)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
	com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
	com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
	com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
	com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
	com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
	com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
	com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
	com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
	java.sql.DriverManager.getConnection(DriverManager.java:512)
	java.sql.DriverManager.getConnection(DriverManager.java:171)
	org.apache.jsp.ch9._1_jsp._jspService(_1_jsp.java:52)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
请问这是怎么回事?
我的jdk目录为C:\j2sdk1.4.2_05
tomcat目录为C:\Tomcat 5.0
数据库目录为C:\Program Files\Microsoft SQL Server
驱动目录为C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC
并把C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib下的三个包拷贝到了
C:\Tomcat 5.0\common\lib下,并在环境变量里的CLASSPATH下添加了这三个包
请高手帮忙
搜索更多相关主题的帖子: SQL 数据库 JSP 
2006-03-25 12:40
飘飘叶子
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:34
帖 子:597
专家分:10
注 册:2005-8-17
得分:0 
你是用什么进行连接的?
记得那3个包应该是copy到tomcat\webapps\工程名\WEB-INF\lib下

向着软件工程师的目标前进!
2006-03-25 13:50
wangtaobig
Rank: 1
等 级:新手上路
威 望:1
帖 子:42
专家分:0
注 册:2006-3-18
得分:0 

一般出现这个信息,主要是数据库出错了!可能你安装了防火墙,这时你需要把防火墙关掉,在关闭SQL SERVER 服务管理,然后在起动服务管理。就OK了,也不知道是不是你出错的原因!如果不对请包含!


2006-03-25 22:05



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




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

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