原文:https://blog.csdn.net/qq_39241986/article/details/80848855

这样的错误,你有遇到过吗?

The TCP/IP connection to the host localhost, port 1433 has failed.
  • 1

com.microsoft.sqlserver.jdbc.SQLServerException:
The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect.
Verify the connection properties.
Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port.
Make sure that TCP connections to the port are not blocked by a firewall.".
  • 1
  • 2
  • 3
  • 4
  • 5

解决方法:

1.选中此电脑–>右键管理–>计算机管理–>服务和应用程序 
   (1)先查看 sql server 服务是否已经开启 
到–>SQL Server 配置管理器–>SQL Server 服务,确保本地Sql Server 服务已经开启。 
 
   (2)再查看 sql server 网络配置 
到–>SQL Server 配置管理器–>SQL Server 网络配置,确保Named PipesTCP/IP 协议为已启用状态。 
 
2.我们再次运行程序,可能会出现还是连接不成功的现象,继续解决问题: 
   还是看 sql server 网络配置 
到–>SQL Server 配置管理器–>SQL Server 网络配置,Named PipesTCP/IP 协议为已启用状态,选中TCP/IP右键–>属性–>IP地址,往下拉滚动条,查看IPALLTCP端口是否为1433,不是,则改为1433。 
 
最后,重启SQL Server服务,然后再运行程序,成功,舒服啦 ! 

JDBC 连Sql Server 接数据库--The TCP/IP connection to the host localhost, port 1433 has failed的更多相关文章

  1. SQL Server 连接问题-TCP/IP

    原文:SQL Server 连接问题-TCP/IP 出自:http://blogs.msdn.com/b/apgcdsd/archive/2012/02/24/ms-sql-server-tcp-ip ...

  2. sql server连接字符串与tcp/ip开启

    连接字符串1:Data Source=localhost,1433;User ID=sa;Password=123;Initial Catalog=test;Min Pool Size=1;Max P ...

  3. JMeter配置JDBC测试SQL Server/MySQL/ORACLE

    一.配置SQL Server 1.下载sql驱动,将sqljdbc4.jar放到JMeter安装目录/lib下. 2.启动JMeter,右键添加->配置文件->JDBC Connectio ...

  4. Java使用JDBC连接SQL Server数据库

    Java使用JDBC连接SQL Server数据库 1.下载驱动 1.下载Microsoft SQL Server JDBC 驱动程序 https://docs.microsoft.com/zh-cn ...

  5. JDBC连接sql server数据库及其它

    JDBC连接sql server数据库的步骤如下: 1.加载JDBC驱动程序: 在连接数据库之前,首先要加载想要连接的数据库的驱动到JVM(Java虚拟机), 这通过java.lang.Class类的 ...

  6. JDBC连接sql server数据库的详细步骤和代码

    JDBC连接sql server数据库的详细步骤和代码 JDBC连接sql server数据库的步骤如下: 1.加载JDBC驱动程序: 在连接数据库之前,首先要加载想要连接的数据库的驱动到JVM(Ja ...

  7. Java使用JDBC连接SQL Server数据库|实现学生成绩信息系统

    Java实验四 JDBC 使用SQL Server数据库或者MySQL数据库各自的客户端工具,完成如下任务: (1)创建数据库students: (2)在数据students中创建表scores,包括 ...

  8. JDBC连接sql server数据库的详细步骤和代码 转

    JDBC连接sql server数据库的步骤如下: 1.加载JDBC驱动程序(只做一次): 在连接数据库之前,首先要加载想要连接的数据库的驱动到JVM(Java虚拟机), 这通过java.lang.C ...

  9. 编写Java程序,使用JDBC连接SQL Server数据库

    返回本章节 返回作业目录 需求说明: 使用JDBC连接SQL Server数据库 SQL Server数据库位于192.168.2.101. 所需连接的数据库为eshop_db,用户名为test,密码 ...

随机推荐

  1. bms_output.put_line使用方法

    https://blog.csdn.net/sxww321/article/details/4020300

  2. MySQL慢查询优化

    MySQL数据库是常见的两个瓶颈是CPU和I/O的瓶颈,CPU在饱和的时候一般发生在大量数据进行比对或聚合时.磁盘I/O瓶颈发生在装入数据远大于内存容量的时候,如果应用分布在网络上,那么查询量相当大的 ...

  3. springboot 零xml集成mybatis-plus

    工程结构 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns=&quo ...

  4. RabbitMQ系列之RabbitMQ集群

    本文的集群是RabbitMq 自身的Cluster搭建 . #hosts准备: vim /etc/hosts #172.16.3.79 s1 #172.16.3.105 s2 172.16.2.10 ...

  5. Hive SQL综合案例

    一 Hive SQL练习之影评案例 案例说明 现有如此三份数据:1.users.dat 数据格式为: 2::M::56::16::70072, 共有6040条数据对应字段为:UserID BigInt ...

  6. day6 ConfigParser模块 yaml模块

        yaml模块: python可以处理yaml文件,yaml文件安装的方法为:$ pip3 install pyyaml    configparser模块,用来处理文件的模块,可以实现文件的增 ...

  7. 【Codechef】Random Number Generator(多项式除法)

    题解 前置技能 1.多项式求逆 求\(f(x)\*g(x) \equiv 1 \pmod {x^{t}}\) 我们在t == 1时,有\(f[0] = frac{1}{g[0]}\) 之后呢,我们倍增 ...

  8. gluster学习(二)

    GlusterFS卷管理 一.卷基本选项设置 1. 调整高速缓存大小 gluster volume set test-volume performance.cache-size 256MB 2. 详细 ...

  9. Java人员正确使用 IntelliJ IDEA的方式

    原文: http://tengj.top/2017/02/22/idea1-1/ 作者: 嘟嘟MD 前言 博主是Java开发人员,以前一直都用myeclipse来开发的,说实话感觉myeclipse毫 ...

  10. (转)最短路算法 -- Floyd算法

    转自:http://blog.51cto.com/ahalei/1383613        暑假,小哼准备去一些城市旅游.有些城市之间有公路,有些城市之间则没有,如下图.为了节省经费以及方便计划旅程 ...