If you want to share your MATLAB® code with others in your organization, then you must create a standalone database application using MATLAB Compiler™. After compiling the database application, you can deploy it to the target machines. Use this procedure and driver-specific information to create and deploy a database application.
Write your database application code and save it as a MATLAB function in a file. Do not save the code as a MATLAB script file. Write the code in function form for database application deployment. Further, you must keep certain things in mind as you write your database application code. For details, see Write Deployable MATLAB Code (MATLAB Compiler).
Compile your database application with MATLAB Compiler using the standalone application packaging process. For details, see Package Standalone Application with Application Compiler App (MATLAB Compiler).
The generated output from the compilation process
contains a folder called
for_testing. Conduct a
test on a target machine using the files found in this folder.
After the test is successful, you can distribute the database application to the target machines in your organization.
Ensure the target machines have the correct driver configuration for your database application. See the following driver-specific tasks to configure data sources and drivers.
After compiling your database application, you must define the data sources referenced in your code on the target machine using the ODBC Data Source Administrator. Then, you can run your database application on the target machine.
For applications that use JDBC drivers, use either option to specify the JDBC driver on the target machine:
your function code to add your JDBC driver JAR file. Do not include
the JAR file in the
Add the JDBC driver JAR file to your
Do not use
javaaddpath in your function code. For Microsoft®
SQL Server® operating
system authentication, add the full path of the library file to the
For details, see Microsoft SQL Server JDBC for Windows.