Java Hibernate sql server Express 连接错误

标签 java spring hibernate sql-server-2008

尝试使用 Hibernate 将 Tomcat 上的 Java Spring 应用程序连接到我的 sqlserver Express 数据库。

出现错误:

com.microsoft.sqlserver.jdbc.SQLServerException: Connection Failed TCP / IP to localhost port 1433.
Error: "Connection refused: connect. Check the connection properties, make
sure that an instance of SQL Server is running on the host and accepting TCP
/ IP connections to port, and make sure that no firewall is blocking TCP 
connections to port. ".

最佳答案

问题是您的 tcp/ip 协议(protocol)不是 1433,请按照以下说明操作,您的问题应该会消失: SqlServer 配置管理器 > Sql 服务器网络配置 > SQLEXPRESS 协议(protocol) > 右键单击​​ TCP/IP > 属性 > IP 地址 > IPALL 并将 TCP 端口更改为 1433

关于Java Hibernate sql server Express 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35287797/

相关文章:

java - 当实体类有子类(可嵌入 id)时,使用 JPA Criteria API 选择查询

java - Spring 3 : @OneToOne unidirectional generate java. sql.SQLException: ORA-00918

java - 为什么 CodedInputStream.readRawVarint64() 正在从底层流中读取所有字节?

java - Spring MBean客户端认为MBean服务是RMI连接

java - Spring Batch 作业 bean 可以延迟初始化吗?

spring - JPA 和 Hibernate 中的 LazyInitializationException

java - Java 中的事件监听器没有应用程序的焦点? (全局按键检测)

java - 使用tomcat在Content-type header 响应中保留分号后的空格

java - 将 WAR 文件部署到 Tomcat 7

java - Spring 3+。通过占位符中的前缀解析属性