Opening SQL Server Express through JDBC in Mathematica?

I have two computers with two (supposedly) identical installations of SQL Server Express 2008 R2 running Windows 7 64-bit. On one computer (call it “red”) I can execute the following math code to open a database connection and read the data

Needs["DatabaseLink`"] conn = OpenSQLConnection[ JDBC[ "Microsoft SQL Server(jTDS)", "localhost"], "Instance" -> "SQLExpress"] 

I have a jTDS driver for sql server installed in c:\windows\system32\ntlmauth.dll . I copied the dll from the red working machine to the black working machine.

I used the SQL-Server import and export tool to migrate a very simple database from red to black and verified that the database is accessible by running LinqPad on black and reading the data. Things are good.

Now I try to run the Mathematica code above on "black" and I get an error message that cannot be confirmed:

JDBC :: error: "! (TraditionalForm` \" Network Error IOException: Connection refused: connect \ ")"

I just know that this will be one of those nightmare permissions with a localservice account or a network service account. I don’t have Sql-Server Management Studio on the “black” machine, and I could not find the appropriate version of SSMS for installation for SQL Server 2008 R2 Express (the version of SSMS Express 2008 does not install, referring to “known compatibility issues”.) I really don’t skipping SSMS as LinqPad works great for my development tasks.

I do not know how to diagnose or manage or act in any way - I am completely blocked and will be very grateful for the advice or recommendations.

+4
source share
2 answers

Some guessing here, but I would try

conn = OpenSQLConnection[ JDBC[ "Microsoft SQL Server(jTDS)", "localhost:1433;instance=SQLExpress"]]

I am sure that OpenSQLConnection [] does not accept the Instance parameter. This might work if it went like this:

conn = OpenSQLConnection[ JDBC[ "Microsoft SQL Server(jTDS)", "localhost:1433"], "Properties"->{"instance"->"SQLExpress"}]

+3
source

Connection failed while connecting to SQL Server. This is not an authentication error.

Your SQL Server may not be configured to accept the query through

through the transport protocol you use. SQL Server Open Surface Configuration

Manager and allow reception of the connection from all available methods.

+3
source

Source: https://habr.com/ru/post/1390173/


All Articles