Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket

[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket

    今天到实验室运行了一下以前作的合同管理的系统,以前运行正常,奇怪的是今天运行出错了。错误提示如标题所示。看来很可能是驱动程序出错了导致连接不上数据库,因此我检查是否启动数据库服务器,服务器已经启动,看来是我用的jdbc的驱动出错了。驱动程序出错总是一件很麻烦的事情。为了保险起见我还是编写了一个用jdbcodbc驱动的小程序来链接数据库,结果是运行正常的。看来是jdbc for sql server2000出错了。这时我想起实验室的一位仁兄用我的机器在另外一个帐号下面又安装了一个sql server2000的实例很可能那就是原因的所在,新装的实例使我以前对sql server2000进行sp4的升级失效导致驱动程序也不能用(jdbc的驱动程序要求sql server2000版本要sp3以上)。于是我重新对sql server升级到sp4问题解决了。

下面是我在网上找到的一些相同现象的解决方法:问题现象虽然相同但是原因可能不同方法也各异。

MS SQL2000 (Error establishing socket)错误的解决办法-SQL请选用混和安装模式

作者:YuLimin

*  Error:  get  DB  connection  error.  Ex.  msg:  java.sql.SQLException:  [Microsoft][SQLServer  2000  Driver  for  JDBC]Error  establishing  socket.  

server java.sql.SQLException:  [Microsoft][SQLServer  2000  Driver  for  JDBC]Error  establishing  socket.  

           at  com.microsoft.jdbc.base.BaseExceptions.createException(Unknown  Source)  

           at  com.microsoft.jdbc.base.BaseExceptions.getException(Unknown  Source)  

           at  com.microsoft.jdbc.base.BaseExceptions.getException(Unknown  Source)  

---------------------------------------------------------------  

无法建立数据库连接,    

确定网络没有问题  

SQL有开着,  

把SQL打到SP3的补丁

  SQL Server2000 SP4要注意,解压之后看到setup.bat这个文件,打开这个文件就开始安装SP4补丁。记得安装后,SQL 服务器是停止了,需要重新启动!安装之后,启动SQL服务器,打开查询分析器,输入select @@version,按F5执行,如果出现Microsoft SQL Server  2000 - 8.00.2039 (Intel X86)   May  3 2005 23:18:38   Copyright (c) 1988-2003 Microsoft Corporation  Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)则说明SQL Server2000的补丁SP4安装成功

驱动也要对应SP3的.  

---------------------------------------------------------------  

1、下载Microsoft  SQL  Server  2000  Service  Pack  3a并安装,SQL请选用混和安装模式!!!  

http://www.microsoft.com/downloads/details.aspx?FamilyId=90DCD52C-0488-4E46-AFBF-ACACE5369FA3&displaylang=zh-cn   

2、下载SQL  Server  2000  Driver  for  JDBC  Service  Pack  3  

http://www.microsoft.com/downloads/details.aspx?FamilyId=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en  

3、运行时关闭防火墙

 

我的操作系统XP,前几天升级到sp2,发现jdbc连接不了sqlserver,报错不能连接,后来我下载了sqlserver sp3,安装的时候总是提示sa密码不正确,后来我登陆微软网站,找到关于sqlserver sp3的帮助文档,发现原来我电脑中的用户环境变量没有设置TEMP和TMP,设置后,update sqlserver sp3成功,然后jdbc连接也正常。
   希望这文章对一些同道中人有所帮助。

 

JDBC SQLSERVER"Error establishing socket"

jdbc配置语句为: jdbc:microsoft:sqlserver://server_name:1433

如运行程序时出现 "Error establishing socket" 错误,则应进行如下调试:


1 检查SQL SERVER 是否允许远程访问.具体步骤:

1)打开"企业管理器",打开控制台根目录>SQL Server 组>数据库
2)在相应"数据库"上单击右键,选择"属性"
3)选择"连接"选项卡,检查"远程服务器连接"下,RPC服务是否选择.

2 使用telnet IP地址 1433,系统是否提示连接出错,如系统提示出错
检查是否防火墙屏蔽了SQL SERVER 或 java IDE 的网络访问端口
如果是,关闭防火墙,重新启动SQL SERVER和java IDE,进行测试,
如果系统仍提示上述错误,尝试下列步骤

3 检查SQL SERVER 端口号及是否启用了TCP/IP协议,具体步骤:

1)打开"企业管理器",打开控制台根目录>SQL Server 组>数据库
2)在相应"数据库"上单击右键,选择"属性"
3)选择"常规"选项卡,点击"网络配置",如启用的协议中无"TCP/IP协议"将其加入
4)选择"TCP/IP协议",点击"属性",检查其端口号是否为1433
5)如端口号为1433将其修改为其它端口号,修改jdbc连接语句,将端口号同样改为新启用的端口号,如jdbc:microsoft:sqlserver://server_name:1400(假设新端口号为 1400)
 
以下的方法你每种的去试试:
#检查一下sql server的connection有没有full.

#如果是认证的问题.
可到sql enterprice manager->指定server->内容->安全性.
把验证改为 SQL server 及 windows.

#点选属性检查一下port是否正确.

#执行%MSSQL_HOME%80ToolsBinnSVRNETCN.exe
把TCP/IP启用.

#关掉防火墙.

#把SQL server update到sp3:
http://www.microsoft.com/sql/downloads/2000/sp3.asp

经我验证,一般升级到sp3就好用了

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This error message typically appears when WordPress is unable to connect to the database that stores all of your site's content, settings, and user data. There are several potential causes for this error, including: 1. Incorrect database login credentials: If the database login credentials in your wp-config.php file are incorrect, WordPress won't be able to connect to the database. 2. Corrupted database: If your WordPress database becomes corrupted, it may not be able to establish a connection. 3. Database server issues: If the database server is down or experiencing issues, WordPress won't be able to connect. 4. Exceeded database limits: If your website has exceeded the database limits set by your hosting provider, you may not be able to connect. 5. Incorrect database host: If the database host in your wp-config.php file is incorrect, WordPress won't be able to connect to the database. To resolve this issue, you can try the following steps: 1. Check your wp-config.php file to ensure that your database login credentials are correct. 2. Try repairing your WordPress database using a tool like phpMyAdmin. 3. Contact your hosting provider to see if there are any issues with the database server. 4. Check if your website has exceeded the database limits set by your hosting provider and upgrade if necessary. 5. Double-check that the database host in your wp-config.php file is correct. If none of these steps work, you may need to contact your hosting provider or a WordPress developer for further assistance.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值