4
$\begingroup$

Having installed sql server 2016 evaluation copy.

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

Typed the following in mathematica

Needs["DatabaseLink`"];

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

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

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

gives the following error

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

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) >>
$Failed

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

OpenSQLConnection[
 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

OpenSQLConnection[
 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

$\endgroup$
8
  • $\begingroup$ 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. $\endgroup$
    – Edmund
    Commented Dec 25, 2015 at 14:50
  • $\begingroup$ Followed the instruction on the post still the same error: JDBC::classnotfound: Microsoft SQL Server (jTDS) >> $Failed $\endgroup$
    – user13892
    Commented Dec 25, 2015 at 15:12
  • $\begingroup$ 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. $\endgroup$
    – Edmund
    Commented Dec 25, 2015 at 15:34
  • $\begingroup$ Ok i am installing the 2014 version of sql server and will try again. Are you sure it works with 2014 right? $\endgroup$
    – user13892
    Commented Dec 26, 2015 at 5:29
  • $\begingroup$ Yes. I use it with 2014 Express at home and 2014 at work. $\endgroup$
    – Edmund
    Commented Dec 26, 2015 at 5:39

0

Browse other questions tagged or ask your own question.