Connect to a Microsoft SQL Server® database
with integrated Windows® Authentication using a JDBC driver.
Close MATLAB® if it is running.
Insert the path to the database driver JAR file in the classpath.txt file.
The classpath.txt file is located at:
$MATLABROOT\toolbox\local\classpath.txt
The updated path entry should now include the full path to the
driver. For example:
C:\DB_Drivers\sqljdbc_2.0\enu\sqljdbc4.jar
Insert the path to the folder containing sqljdbc_auth.dll in
the librarypath.txt file. The librarypath.txt file
is located at:
$MATLABROOT\toolbox\local\librarypath.txt
The path entry should not include the file name sqljdbc_auth.dll:
C:\DB_Drivers\sqljdbc_2.0\enu\auth\x64
The sqljdbc_auth.dll file is installed in
the following location:
<installation>\sqljdbc_<version>\<language>\auth\<arch>
where <installation> is
the installation directory of the SQL server driver.
If you are running a 32-bit Java® Virtual Machine
(JVM), then use the sqljdbc_auth.dll file in the
x86 folder, even if the operating system is the x64 version.
If you are running a 64-bit JVM on a x64 processor,
then use the sqljdbc_auth.dll file in the x64 folder.
If you are running a 64-bit JVM on a IA-64 processor,
then use the sqljdbc_auth.dll file in the IA64
folder.
Start MATLAB.
Use the AuthType parameter to establish
a Windows Authentication connection.
conn = database('dbName','','', ...
'Vendor','Microsoft SQL Server','Server','servername',...
'AuthType','Windows')