Mathematica 10.3 on Windows 10 Home Premium Connection to SQL Server 2016


Having installed sql server 2016 evaluation copy.

I have setup a sample database using sql server management studio.

Typed the following in mathematica


JDBCDrivers["Microsoft SQL Server(jTDS)"];

No error in the output of the two commands. MS SQL Server is using windows authentication for login.

 JDBC["Microsoft SQL Server (jTDS)", "server/database"], 
 "Username" -> "user", "Password" -> "password"]

gives the following error

JDBC::classnotfound: Microsoft SQL Server (jTDS) >>

Please help i am a new to this. Just learned sql server and now want to integrate it into mathematica.

Also are there any tutorial on DatabaseLink package of mathematica

After following the instruction on the other post i still get the same error

JDBC::classnotfound: Microsoft SQL Server (jTDS) >>

Also for windows authentication should i just use the following then right?

 JDBC["Microsoft SQL Server (jTDS)", "server/database"]]

The server name is DESKTOP-4SGK8AQ and database name is LearningSQL so i am using the following code

 JDBC["Microsoft SQL Server (jTDS)", "DESKTOP-4SGK8AQ/LearningSQL"]]

Everything works now "Microsoft SQL Server (jTDS)" should be corrected to "Microsoft SQL Server(jTDS)". My mistake


Posted 2015-12-25T14:45:08.613

Reputation: 7 041

Question was closed 2015-12-25T18:24:01.953

With Windows Authentication you need to download a jTDS dll file. Read this post. Also, note that you should not set the Username and Password in the connection when using Windows Authentication.

– Edmund – 2015-12-25T14:50:31.427

Followed the instruction on the post still the same error: JDBC::classnotfound: Microsoft SQL Server (jTDS) >> $Failed – user13892 – 2015-12-25T15:12:27.357

There is a 32bit and a 64bit version of the file. You have to put the right version in the correct Java directory. You should check it works with 2014 as well. In case it is a bug with Mathematica and 2016. You can get SQL Server Express 2014 is free. – Edmund – 2015-12-25T15:34:06.747

Ok i am installing the 2014 version of sql server and will try again. Are you sure it works with 2014 right? – user13892 – 2015-12-26T05:29:11.980

Yes. I use it with 2014 Express at home and 2014 at work. – Edmund – 2015-12-26T05:39:58.337

Thank you Edmund, is it possible can you tell me the exact commands you use to connect to a database kept on your local machine on windows with windows authentication. That would make life easier. Also is there any setting in the management studio that i have to do before the connection? – user13892 – 2015-12-26T05:47:46.767

Copying the ntlmauth.dll file from x64\SSO to C:\Program Files\Wolfram Research\Mathematica\10.3\SystemFiles\Java\Windows-x86-64\bin

and from x86\SSO to C:\Program Files\Wolfram Research\Mathematica\10.3\SystemFiles\Java\Windows\bin

does nothing. Does it need to be placed someplace else?

Also now i am running SQL Server 2014 now – user13892 – 2015-12-26T09:09:30.743

I made a chat and put some comments on setup there. dbConn = OpenSQLConnection[ JDBC["Microsoft SQL Server(jTDS)", "LOCALHOST"], "Instance" -> "SQLEXPRESS", "DatabaseName" -> "Testing"] – Edmund – 2015-12-26T12:55:19.717

No answers