Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Access Relational Database Data in MATLAB

This tutorial shows how to use Database Toolbox™ with relational databases. To gain the maximum benefit from this toolbox and understand its capabilities, use the following steps and decision flow chart.

  1. If you do not have an installed database and want to store relational data quickly, use the MATLAB® interface to SQLite. For details, see Working with MATLAB Interface to SQLite.

  2. Install your database. For details, refer to your database administrator or your database documentation.

  3. Choose between using the Database Explorer app or the command line.

  4. Choose between using an ODBC driver or a JDBC driver. For details, see Choosing Between ODBC and JDBC Drivers.

  5. For ODBC drivers, the driver is typically preinstalled on your computer. For JDBC drivers, install the driver. For details about ODBC and JDBC drivers, see Driver Installation. If you have questions about which driver you need, refer to your database administrator or your database documentation.

  6. Create a data source for ODBC-compliant drivers. For JDBC-compliant drivers, add the full path of the driver to the static Java® class path. Then, create a data source for JDBC-compliant drivers. For details, see Configuring Driver and Data Source.

  7. Test the connection to your database using the Database Explorer app or the command line.

  8. Connect to your database using the Database Explorer app or the command line. For details, see Connecting to Database.

  9. Select data from your database and import the data into a MATLAB variable by using the Database Explorer app or the command line. For details, see Data Import Using Database Explorer App or Command Line.

  10. Insert data into your database by exporting data from a MATLAB variable. For details, see Inserting Data Using Command Line.

  11. When you use the Database Explorer app to import data, generate a MATLAB script to automate your tasks. For details, see Generate MATLAB Script.

This flow chart illustrates the steps to take and the decisions to make when you use Database Toolbox with relational databases.

Related Topics

Was this topic helpful?