User`s guide

Microsoft SQL Server JDBC for Windows
2-37
3
Close MATLAB if it is running.
4
Navigate to the folder and create a file called javalibrarypath.txt in the folder.
5
Open javalibrarypath.txt and insert the path to the Java library file
sqljdbc_auth.dll. In the entry, include the full path to the library file. Do not
include the library file name. For example, C:\DB_Drivers\sqljdbc_4.0\enu
\auth\x64.
The sqljdbc_auth.dll file is installed in the following location:
<installation>\sqljdbc_<version>\<language>\auth\<arch>
<installation> is the installation folder of the Microsoft SQL Server JDBC driver,
<version> is the JDBC driver version, <language> is the JDBC driver language,
and <arch> is the architecture.
For 64-bit MATLAB, use the x64 folder.
For 32-bit MATLAB, use the x86 folder.
6
Open MATLAB.
Step 4. Add the JDBC driver to the MATLAB static Java class path.
1
Run the prefdir command in the Command Window. The output is a file path to a
folder on your computer.
2
Close MATLAB if it is running.
3
Navigate to the folder and create a file called javaclasspath.txt in the folder.
4
Open javaclasspath.txt. Add the full path to the database driver JAR file in
javaclasspath.txt. The full path includes the path to the folder where you
downloaded the JAR file from the database provider and the JAR file name. For
example, C:\DB_Drivers\sqljdbc_4.0\enu\sqljdbc4.jar. Save and close
javaclasspath.txt.
5
Restart MATLAB.
Alternatively, you can use javaaddpath to add your JDBC driver to the dynamic Java
class path. For details about static and dynamic class paths, see “Bringing Java Classes
into MATLAB Workspace”.