我正在尝试使用 jtds 驱动程序将 Netbeans 设置为与 Hibernate 一起使用以连接到 SQLSERVER 2008。
sqlserver 2008 是本地安装的,没有用户名和密码。
这是hibernate.cfg:
<?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.show_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:2545/MyDB</property>
</session-factory>
</hibernate-configuration>
当我尝试使用 Hibernate 逆向工程向导设置 Hibernate 逆向工程文件时,我收到以下错误:
无法连接。无法使用 net.sourceforge.jtds.jdbc.Driver 建立与 jdbc:jtds:sqlserver://localhost:2545/MyDB 的连接(I/O 错误:SSO 失败:未加载本机 SSPI 库。检查 java.library.path系统属性。)。
我在 WINDOWS\system32 中有 ntlmauth.dll。