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.

Connect to Database Programmatically

Establish connection to relational databases and retrieve information about their structures using command line

Database Toolbox™ enables you to connect to various relational databases by installing the database and driver. If you do not want to install a database and driver, you can use the MATLAB® interface to SQLite.

After establishing a database connection, you can explore database contents and structure using the command line. Close the database connection when you are finished.

Objects

connectionRelational database connection

Functions

expand all

closeClose and invalidate database and driver resource utilizer
databaseConnect to database
isopenDetermine if database connection is open
getdatasourcesReturn names of ODBC and JDBC data sources
sqlfindFind information about all table types in database
closeClose SQLite connection
sqliteSQLite connection

Topics

Connect to Database

Connecting to Database

After configuring a driver and data source, connect to your database.

Working with MATLAB Interface to SQLite

Analyze data without access to a database or driver by using the MATLAB interface to SQLite.

Retrieve Information About Database Structure

Retrieve Database Metadata

Find information about the database, tables, and columns using the connection object and the sqlfind function.

Data Retrieval Restrictions

Identify restrictions on table and column names for data retrieval.