This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Deploying Database Application with MATLAB Compiler

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.

Create and Deploy Database Application

  1. 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).

  2. Compile your database application with MATLAB Compiler using the standalone application packaging process. For details, see Create Standalone Application from MATLAB (MATLAB Compiler).

  3. 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.

  4. After the test is successful, you can distribute the database application to the target machines in your organization.

About Driver Configurations

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.

Native ODBC and ODBC 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.

JDBC Drivers

For applications that use JDBC drivers, use either option to specify the JDBC driver on the target machine:

  • Use javaaddpath in your function code to add your JDBC driver JAR file. Do not include the JAR file in the javaclasspath.txt file.

  • Add the JDBC driver JAR file to your javaclasspath.txt file. 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 javalibrarypath.txt file. For details, see Microsoft SQL Server JDBC for Windows.


Do not add driver JAR files using javaclasspath as this might cause issues on the target machine. For details, see Java Class Path (MATLAB).

See Also

Related Topics