按照上面的,我已經試過:如何使用ActiveRecord連接到SQL Server,JDBC,JTDS和集成安全
establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain='mynetwork';", :username => 'user', :password=>'pass')
establish_connection(:adapter => "jdbcmssql", :url => 'jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain="mynetwork";user="mynetwork\user"')
establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain='mynetwork';", :username=>'user')
establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver:1433/mydatabase;domain='mynetwork';integratedSecurity='true'", :username=>'user')
..和其他各種組合。
每次我得到:
net/sourceforge/jtds/jdbc/SQLDiagnostic.java:368:in `addDiagnostic': java.sql.SQLException: Login failed for user ''. The user is not associated with a trusted SQL Server connection. (NativeException)
如果我嘗試它沒有用戶信息:
establish_connection(:adapter => "jdbcmssql", :url => "jdbc:jtds:sqlserver://myserver/mydatabase")
我得到這樣的迴應:
net/sourceforge/jtds/jdbc/SQLDiagnostic.java:368:in `addDiagnostic': java.sql.SQLException: Login failed for user 'sa'. (NativeException)
任何提示嗎?謝謝,
- 的ActiveRecord(2.3.5)
- 的ActiveRecord-JDBC適配器(0.9.6)
- 的ActiveRecord-jdbcmssql適配器(0.9.6)
- JDBC-JTDS(1.2.5 )
- 的JRuby 1.4.0(紅寶石1.8.7補丁號174)(2009-11-02 69fbfa3)(Java的熱點(TM)客戶端VM 1.6.0_18)[86-java的]
感謝LIMC - 我想這和更新的問題 – Rob 2010-05-18 04:07:12