JDBC连接SqlServer2000出现"Connection refused: connect"的解决方案
来源:互联网 发布:linux如何查看进程id 编辑:程序博客网 时间:2024/04/27 23:52
JDBC连接SqlServer2000出现"Connection refused: connect"的解决方案
错误信息如下所示:
- java.sql.SQLException: Network error IOException: Connection refused: connect
- at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:385)
- at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
- at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
- at java.sql.DriverManager.getConnection(Unknown Source)
- at java.sql.DriverManager.getConnection(Unknown Source)
- at test.Test.main(Test.java:33)
- Caused by: java.net.ConnectException: Connection refused: connect
- at java.net.PlainSocketImpl.socketConnect(Native Method)
- at java.net.PlainSocketImpl.doConnect(Unknown Source)
- at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
- at java.net.PlainSocketImpl.connect(Unknown Source)
- at java.net.SocksSocketImpl.connect(Unknown Source)
- at java.net.Socket.connect(Unknown Source)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:304)
- at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:255)
- at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:310)
- ... 5 more
解决方案如下:
一.查看端口信息
使用JDBC在默认端口1433上连接SQL Server获得connection refused异常,大致异常信息为:
The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused。
1.使用telnet 127.0.0.1 1433测试,得到如下信息:
正在连接到127.0.0.1...不能打开到主机的连接, 在端口 1433: 连接失败表示1433端口没有
打开
2.检查SQL Server服务已经启动。于是用网络工具扫描端口,发现和SQL Server服务相关的端口
为1109和1434。不过1434为UDP端口,所以当前的连接端口应为1109。可以使用SQL Server的
“服务器实用网络工具”修改默认端口。打开“服务器使用网络工具”后,在“常规”选项
卡中的“启用的协议”列表中,选择“TCP/IP”,然后点击“属性”按钮,就可以看到默认
的端口值。修改后,重启SQL Server服务,即可使用修改后的端口连接服务器。
二.安装更新
SQL Server 2000 Service Pack 4 (SP4):
You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with the Microsoft Windows Server 2003 family. To reduce your computer's vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install SQL Server 2000 Service Pack 3a, or the most recent service pack for Microsoft SQL Server 2000 or MSDE from http://www.microsoft.com/sql/downloads/2000/sp4.mspx.
- JDBC连接SqlServer2000出现"Connection refused: connect"的解决方案
- MSSQL异常:JDBC连接SqlServer2000出现"Connection refused: connect"解决方案
- JDBC连接SQL Server 2005出现Connection refused:connect
- JDBC 连接SQL Server:Connection refused: connect
- JDBC 连接SQL Server报错:Connection refused: connect
- sqlserver2008 jDBC 连接报错:Connection refused: connect
- 使用Jedis出现Connection refused的解决方案
- JDBC连接SQL Server出现的connection refused问题的解决办法
- com.microsoft.sqlserver.jdbc.SQLServerException: 到主机的TCP/IP 连接失败。java.net.ConnectException: Connection refused: connect
- om.microsoft.sqlserver.jdbc.SQLServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection refused: connect
- java.net.ConnectException: Connection refused: connect 完美解决(SQLserver2000)
- redis连接失败 Connection refused: connect
- java 通过用jdbc:odbc方式连接MSSQL2008 Connection refused: connect 问题处理
- scp时候出现ssh Connection refused的解决方案
- scp时候出现ssh Connection refused的解决方案
- SSH连接GitHub出现 ssh: connect to host github.com port 22: Connection refused解决方法
- 程序连接SQL Sever数据库出现:java.sql.SQLException: Network error IOException: Connection refused: connect 错误
- Linux连接redis客户端出现Could not connect to Redis at 127.0.0.1:6379: Connection refused
- c#表适配器(Adapters)介绍
- 总结一下BusinessBase都含有哪些功能
- Linux的标准发音
- 总结一下BusinessListBase都做了哪些功能
- 计算机取证强大工具
- JDBC连接SqlServer2000出现"Connection refused: connect"的解决方案
- C# 使用表适配器填充和更新强类型数据集
- Managing a Honeypot
- 恭喜您中二等奖?原来是中标了——IEPlus.exe/Trojan.Win32.QQFish.x/Packed.Win32.Klone
- C# static的全部用法收集整理
- 封面
- Socket HTTP页面请求后对gzip页面的解压缩实现代码
- [转]C# 播放器空件 的常用方法
- 《没有任何借口》读后感