User`s guide
6 Using Database Toolbox Functions
6-34
Display Database Metadata
This example shows how to display database information for database connection objects
using the command line. To view the database structure quickly, use Database Explorer
to explore the tables and column names. Here, metadata refers to the information about
the database structure and various database properties.
Create the Database Connection
Create a connection conn using the dbtoolboxdemo data source.
conn = database('dbtoolboxdemo','admin','admin');
Create the Database Metadata Object
Create a database metadata object dbmeta using conn.
dbmeta = dmd(conn)
dbmeta =
DMDHandle: [1x1 sun.jdbc.odbc.JdbcOdbcDatabaseMetaData]
Display Database Properties
Display the database properties dbprops of the database metadata object dbmeta.
dbprops = get(dbmeta)
dbprops =
AllProceduresAreCallable: 1
AllTablesAreSelectable: 1
DataDefinitionCausesTransactionCommit: 1
...
For details about the database metadata properties returned by get, see the methods of
the DatabaseMetaData object on the Oracle Java website:
http://docs.oracle.com/javase/7/docs/api/java/sql/
DatabaseMetaData.html.
Display the properties props this database supports using dbmeta.
props = supports(dbmeta)