How to connect to SQL Server using activerecord, JDBC, JTDS and Integrated Security
Posted
by Rob
on Stack Overflow
See other posts from Stack Overflow
or by Rob
Published on 2010-05-17T23:59:09Z
Indexed on
2010/05/18
0:10 UTC
Read the original article
Hit count: 761
As per the above, I've tried:
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' )
.. and various other combinations.
Each time I get:
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)
Any tips? Thanks,
- activerecord (2.3.5)
- activerecord-jdbc-adapter (0.9.6)
- activerecord-jdbcmssql-adapter (0.9.6)
- jdbc-jtds (1.2.5)
- jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]
© Stack Overflow or respective owner