`
仁生之狼
  • 浏览: 42828 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

sql server 2008 配置(jre1.6及更新版本)

阅读更多
使用sqljdbc4.jar
刚开始配置了hibernate.cfg.xml属性
<property name="hibernate.connection.url">
jdbc:sqlserver://localhost:1433;DatabaseName=hibernate
</property>
<property name="hibernate.connection.driver_class">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password">admin</property>
<property name="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</property>
运行报出如下错误:
com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:“connect timed out。请验证连接属性,并检查 SQL Server 的实例正在主机上运行,且在此端口接受 TCP/IP 连接,还要确保防火墙没有阻止到此端口的 TCP 连接。”
之后通过
在命令行 输入 netstat -an查看有没有1433端口,发现没有
修改配置如下:

<property name="hibernate.connection.url">
jdbc:sqlserver://localhost:1434;DatabaseName=hibernate
</property>

运行成功



查询分析其中查看sql server 2008端口:

exec sys.sp_readerrorlog 0, 1, 'listening'
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics