开发者

Connect SBCL on Windows to SQL Server using Integrated Authentication

What is the path of least resistance in getting an SB开发者_开发技巧CL application running on Windows to connect to a SQL Server instance, using integrated authentication?

I have found posts on connecting from CL-SQL to SQL Server using ODBC connections but as far as I can tell, there is no way to this without first manually setting up a DSN.

Is there a simple way to accomplish this?


There is a cl-mssql library that uses FreeTDS to communicate with MSSQL server. According to http://www.freetds.org/userguide/domains.htm, FreeTDS will use Integrated Authentication if you specify the login like 'DOMAIN\Username'. So it might work with cl-mssql (though I haven't used it).


The path of least resistance for this (SBCL, Windows, no-DSN) seems to be plain-odbc.

(asdf:load-system :plain-odbc)
(use-package :plain-odbc)
(setf conn (connect-generic :driver "{SQL Server}"
                            :database "dbname"
                            :server "servername"
                            :trusted_connection "yes"))
(exec-query conn "select * from some_table")

Don't use (connect-sql-server ...) as it requires a default DSN, *default-sql-server-dsn*.

There may be a better driver to specify, as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜