0
我想將我的java項目連接到SQL Server 2005數據庫,但不幸的是我遇到了一些問題。 我使用Windows身份認證(我的電腦的名字是BOURKADIXP沒有密碼),這裏是我的hibernate.cfg:Hibernate和SQL Server 2005之間的連接異常
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.connection.password">azerty</property>
<property name="hibernate.connection.url">jdbc:jtds:sqlserver://127.0.0.1/DBM6000</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
</session-factory>
</hibernate-configuration>
,這裏是我有例外:
org.hibernate.exception.JDBCConnectionException: Getting database metadata
Getting database metadata
java.sql.SQLException: Network error IOException: Connection refused: connect
Network error IOException: Connection refused: connect
java.sql.SQLException: Network error IOException: Connection refused: connect
Network error IOException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
Connection refused: connect
感謝您的幫助!
如何檢查tcp/ip是否允許? – Bourkadi 2012-07-31 14:51:21
我激活了tcp/ip連接,但我仍然遇到同樣的問題 – Bourkadi 2012-07-31 16:05:32
是否可以通過telnet連接 1433? –
2012-07-31 16:54:58