使用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'
分享到:
相关推荐
若jre是1.6版本则使用sqljdbc4架包,否则就使用sqljdbc架包。
环境:win10 64位 ,SqlServer 2008R2,eclipse 希望目标:JDK6不更换,连接SQLServer2008R2 解决步骤: 第一步: 下载两个jar包:bcprov-ext-jdk15on-1.54.jar和bcprov-jdk15on-1.54.jar 点击下载jar包 第二步:将...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
修改了Solaris、Linux下的启动问题。 通用数据库连接查询器,支持Oracle、DB2、... 纯绿色,免安装,跨平台,只要您有jre1.6以上版本,可以在任何平台运行。内存优化,基本不会遇到java常见的内存溢出问题。
修改了两个启动问题,Linux或Unix下如果启动失败,请检查系统权限。... 纯绿色,免安装,跨平台,只要您有jre1.6以上版本,可以在任何平台运行。只要您的数据库允许,可以一次性取回上100兆数据。
通用数据库连接查询器,支持Oracle、DB2、SQL Server、MySQL、PostgreSQL、Sybase... 纯绿色,免安装,跨平台,只要您有jre1.6以上版本,可以在任何平台运行。只要您的数据库允许,可以一次性取回上100兆数据。
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...
Third-party database drivers for Sybase, SQL Server and MySQL. For more information on setting up the third-party drivers, see Migrations: Getting Started Version control systems, Concurrent Versions...