1. Download the JDBC driver from Microsoft from:
2. Execute it, in will be decompressed to the selected location
3. Start the Notepad application as administrator and open the file:
C:\Program Files\MATLAB\R2010a\toolbox\local\classpath.txt
4. Add a reference like this to the JDBC driver after the last line of that file:
c:/SQLJDBC/sqljdbc_2.0/enu/sqljdbc4.jar
5. After that you have to restart MATLAB and then you can test the connection:
dbConn = database('master', 'user', 'password', 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 'jdbc:sqlserver://localhost:1433;databaseName=master;');
6. To test the connection you can execute:
ping(dbConn);
7. Please not that the local instance of SQL Server require to have the TCP/IP protocol network connections enabled.
No comments:
Post a Comment