`
deepfuture
  • 浏览: 4412009 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:80128
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:70342
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:103582
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:286551
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:15054
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:67785
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:32292
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:46075
社区版块
存档分类
最新评论

matlab-数据库元信息

 
阅读更多


dmd


Construct database metadata object
Syntax


dbmeta = dmd(conn)

Description


dbmeta = dmd(conn) constructs a database metadata object for the database connection conn. Use get and supports to obtain properties of dbmeta. Use dmd and get(dbmeta) to obtain information you need about a database, such as table names required to retrieve data.

For a list of functions that operate on database metadata objects, enter:
help dmd/Contents


Examples


dbmeta = dmd(conn) creates a database metadata object dbmeta for the database connection conn.

v = get(dbmeta) lists properties of the database metadata object.

 

=================================
supports


Detect whether property is supported by database metadata object
Syntax


a = supports(dbmeta)
a = supports(dbmeta, 'property')
a.property

Description


a = supports(dbmeta) returns a structure that contains the properties of dbmeta and its property values, 1 or 0. A value of 1 indicates that the property is supported, and 0 indicates that the property is not supported.

a = supports(dbmeta, 'property') returns 1 or 0 for the property field of dbmeta. A value of 1 indicates that the property is supported, and 0 indicates that the property is not supported.

a.property returns the value of property after you have created a using the supports function.
Examples


Check if dbmeta supports group-by clauses.
a = supports(dbmeta, 'GroupBy')
a =
     1

 

View the value of all properties of dbmeta.
a = supports(dbmeta)

 

The returned result is a list of properties and their values.

See the value of the GroupBy property by running:
a.GroupBy
a =
     1

 

===============================

 


tables


Return database table names
Syntax


t = tables(dbmeta, 'cata')
t = tables(dbmeta, 'cata', 'sch')

Description


t = tables(dbmeta, 'cata') returns a list of tables and table types in the catalog cata, for the database whose database metadata object is dbmeta.

t = tables(dbmeta, 'cata', 'sch') returns a list of tables and table types in:

The schema sch

Of the catalog cata

For the database whose database metadata object is dbmeta

 

Tip   For command-line help on tables, use the overloaded method:
help dmd/tables


Examples


Get the table names and types for the schema SCOTT in the catalog orcl, for the database metadata object dbmeta.
t = tables(dbmeta,'orcl', 'SCOTT')
t =
    'BONUS'       'TABLE'
    'DEPT'        'TABLE'
    'EMP'         'TABLE'
    'SALGRADE'    'TABLE'
    'TRIAL'       'TABLE'

上机 操作

>> myconn=database('students','mytest','deepfuture','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/students')
 
myconn =
 
       Instance: 'students'
       UserName: 'mytest'
         Driver: 'com.mysql.jdbc.Driver'
            URL: 'jdbc:mysql://localhost:3306/students'
    Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
        Message: []
         Handle: [1x1 com.mysql.jdbc.JDBC4Connection]
        TimeOut: 0
     AutoCommit: 'on'
           Type: 'Database Object'

>> mydbmetaa=dmd(myconn)
 
mydbmetaa =
 
    DMDHandle: [1x1 com.mysql.jdbc.JDBC4DatabaseMetaData]

 

>> myv=get(mydbmetaa)

myv =

                 AllProceduresAreCallable: 0
                   AllTablesAreSelectable: 0
    DataDefinitionCausesTransactionCommit: 1
      DataDefinitionIgnoredInTransactions: 0
               DoesMaxRowSizeIncludeBlobs: 1
                                 Catalogs: {3x1 cell}
                         CatalogSeparator: '.'
                              CatalogTerm: 'database'
                      DatabaseProductName: 'MySQL'
                   DatabaseProductVersion: '5.5.25a'
              DefaultTransactionIsolation: 2
                       DriverMajorVersion: 5
                       DriverMinorVersion: 1
                               DriverName: 'MySQL-AB JDBC Driver'
                            DriverVersion: [1x60 char]
                      ExtraNameCharacters: '#@'
                    IdentifierQuoteString: '`'
                         IsCatalogAtStart: 1
                   MaxBinaryLiteralLength: 16777208
                     MaxCatalogNameLength: 32
                     MaxCharLiteralLength: 16777208
                      MaxColumnNameLength: 64
                      MaxColumnsInGroupBy: 64
                        MaxColumnsInIndex: 16
                      MaxColumnsInOrderBy: 64
                       MaxColumnsInSelect: 256
                        MaxColumnsInTable: 512
                           MaxConnections: 0
                      MaxCursorNameLength: 64
                           MaxIndexLength: 256
                   MaxProcedureNameLength: 0
                               MaxRowSize: 2.1475e+009
                      MaxSchemaNameLength: 0
                       MaxStatementLength: 65531
                            MaxStatements: 0
                       MaxTableNameLength: 64
                        MaxTablesInSelect: 256
                        MaxUserNameLength: 16
                         NumericFunctions: [1x144 char]
                            ProcedureTerm: 'PROCEDURE'
                                  Schemas: {}
                               SchemaTerm: ''
                       SearchStringEscape: '\'
                              SQLKeywords: [1x1116 char]
                          StringFunctions: [1x374 char]
               StoresLowerCaseIdentifiers: 1
         StoresLowerCaseQuotedIdentifiers: 1
               StoresMixedCaseIdentifiers: 0
         StoresMixedCaseQuotedIdentifiers: 0
               StoresUpperCaseIdentifiers: 0
         StoresUpperCaseQuotedIdentifiers: 1
                          SystemFunctions: [1x78 char]
                               TableTypes: {3x1 cell}
                        TimeDateFunctions: [1x289 char]
                                 TypeInfo: {40x1 cell}
                                      URL: [1x36 char]
                                 UserName: 'mytest@localhost'
                    NullPlusNonNullIsNull: 1
                      NullsAreSortedAtEnd: 0
                    NullsAreSortedAtStart: 0
                       NullsAreSortedHigh: 0
                        NullsAreSortedLow: 1
                    UsesLocalFilePerTable: 0
                           UsesLocalFiles: 0

数据库项目(包含的数据库)

>> myv.Catalogs

ans =

    'information_schema'
    'students'
    'test'

>>

元数据对象支持和不支持的属性

>> mys=supports(mydbmetaa)

mys =

                          AlterTableWithAddColumn: 1
                         AlterTableWithDropColumn: 1
                              ANSI92EntryLevelSQL: 1
                                    ANSI92FullSQL: 0
                            ANSI92IntermediateSQL: 0
                       CatalogsInDataManipulation: 1
                       CatalogsInIndexDefinitions: 1
                   CatalogsInPrivilegeDefinitions: 1
                         CatalogsInProcedureCalls: 1
                       CatalogsInTableDefinitions: 1
                                   ColumnAliasing: 1
                                          Convert: 0
                                   CoreSQLGrammar: 1
                             CorrelatedSubqueries: 1
    DataDefinitionAndDataManipulationTransactions: 0
                 DataManipulationTransactionsOnly: 0
                   DifferentTableCorrelationNames: 1
                             ExpressionsInOrderBy: 1
                               ExtendedSQLGrammar: 0
                                   FullOuterJoins: 0
                                          GroupBy: 1
                              GroupByBeyondSelect: 1
                                 GroupByUnrelated: 1
                     IntegrityEnhancementFacility: 0
                                 LikeEscapeClause: 1
                                LimitedOuterJoins: 1
                                MinimumSQLGrammar: 1
                             MixedCaseIdentifiers: 0
                       MixedCaseQuotedIdentifiers: 0
                               MultipleResultSets: 1
                             MultipleTransactions: 1
                               NonNullableColumns: 1
                          OpenCursorsAcrossCommit: 0
                        OpenCursorsAcrossRollback: 0
                       OpenStatementsAcrossCommit: 0
                     OpenStatementsAcrossRollback: 0
                                 OrderByUnrelated: 0
                                       OuterJoins: 1
                                 PositionedDelete: 0
                                 PositionedUpdate: 0
                        SchemasInDataManipulation: 0
                        SchemasInIndexDefinitions: 0
                    SchemasInPrivilegeDefinitions: 0
                          SchemasInProcedureCalls: 0
                        SchemasInTableDefinitions: 0
                                  SelectForUpdate: 1
                                 StoredProcedures: 1
                          SubqueriesInComparisons: 1
                               SubqueriesInExists: 1
                                  SubqueriesInIns: 1
                          SubqueriesInQuantifieds: 1
                            TableCorrelationNames: 1
                                     Transactions: 1
                                            Union: 1
                                         UnionAll: 1

某个数据库包含的表

>> tables(mydbmetaa,'students')

ans =

    'student'    'TABLE'

>>  

分享到:
评论

相关推荐

    matlab开发-数据库工具箱

    总的来说,MATLAB数据库工具箱结合Matlabadt库,为音频数据的分析和处理提供了一个强大且灵活的环境,使得研究人员和开发人员能够专注于他们的核心任务,而不必过多关注底层的数据库操作。无论是简单的数据检索还是...

    matlab开发-数据库地窖射线

    演示如何在数组数据库中保存新信息,通常涉及以下步骤: 1. **建立连接**:首先,我们需要使用`database`函数创建一个数据库连接对象,指定数据库类型、驱动程序、服务器地址、数据库名、用户名和密码。 2. **创建...

    matlab开发-数据库中的大型数据处理案例研究

    本案例研究聚焦于如何高效地使用MATLAB处理存储在数据库中的大规模数据,以实现有效的控制策略。以下是对相关文件内容的详细解读: 1. **speedup.fig**:这个文件可能是一个图形用户界面(GUI)设计,用于展示...

    matlab开发-访问数据库

    在进行MATLAB数据库开发时,理解基本的数据库连接和查询方法,以及如何利用自定义工具如`MYM.M`,将极大地提高你的工作效率。确保遵守许可证规定,并合理利用提供的辅助工具,将使你在MATLAB数据库编程中游刃有余。

    零散MATLAB资料分享-Matlab数据库编程入门.pdf

    零散MATLAB资料分享-Matlab数据库编程入门.pdf 最近在用MATLAB做一个项目,自然需要查很多东西,在网上搜集了一点资料,并非原创。本着分享的精神,希望能帮助到部分人。 包括以下内容 在MATLAB图形用户...

    matlab开发-数据库图像融合

    本项目聚焦于使用MATLAB进行数据库图像融合,特别是采用主成分分析(PCA)方法。MATLAB是MathWorks公司推出的一种高级编程环境,特别适合于数值计算、符号计算以及数据可视化等任务。 首先,我们要理解主成分分析...

    基于MATLAB的数据库开发

    基于外部数据源的MATLAB数据库开发** 外部数据源通常指的是通过ODBC(Open Database Connectivity)接口连接的数据库。ODBC是一个标准的API,允许不同的DBMS之间进行通信。MATLAB通过ODBC-JDBC桥接器与数据库建立...

    基于MATLAB的数据库开发.pdf

    1. 基于外部数据源的MATLAB数据库开发 外部数据源指的是MATLAB能够连接和操作的数据库系统,如Microsoft Access、MySQL、Oracle等。开发基于外部数据源的MATLAB数据库涉及的关键技术是ODBC(开放式数据库连接)。 ...

    matlab开发-从映像创建数据库

    `license.txt`文件通常包含软件的许可协议信息,对于MATLAB来说,这可能是关于使用MATLAB和相关数据库工具箱的法律条款和限制。在使用任何代码或库之前,都应该仔细阅读并遵守这些条款。 在硬件、物联网和测试与...

    matlab提取文件要素代码-matlab-lsdyna:Matlab-Lsdyna

    该项目包含来自有限元求解器LS-DYNA的ascii结果文件的阅读器,以及用于从MATLAB中以编程方式运行LS-DYNA模拟的包装器。 该项目与LS-DYNA的创建者或发行者没有任何关系,因此是完全非官方的。 目前,matlab-lsdyna是...

    MATLAB、数据库、GUI的构建代码

    在IT领域,MATLAB是一种广泛使用的...总之,这个压缩包提供了一个学习MATLAB数据库编程和GUI设计的实践平台,通过研究和实践其中的代码,你可以提升MATLAB编程技能,并掌握如何在实际项目中利用数据库和GUI来解决问题。

    约翰霍普金斯大学湍流数据库 web servier-matlab-tool包

    约翰霍普金斯大学湍流数据库 Web 服务器-MATLAB 工具包是一个专门为研究湍流现象和数据处理设计的工具集。这个包是研究人员、工程师以及对流体动力学感兴趣的学者的重要资源,它提供了方便的数据访问接口以及一系列...

    MATLAB解读MIT-BIH数据库中心电数据的源代码

    MATLAB解读MIT-BIH数据库中心电数据的源代码,个人编写,内涵详细注释。解读代码封装为函数ReadMITData,输入为MIT文件路径及编号(比如100),输出2导联心电波形数据、每个QRS波位置、心搏注释结果。可解析全部48组...

    matlab开发-dbarraypackandunpackdatabasearraystomatlabrays数据库

    matlab开发-dbarraypackandunpackdatabasearraystomatlabrays数据库。dbarray允许您直接将array[]类型的数据库字段发送/获取到本地的MATLAB变量中

    matlab开发-ChangeSystemDSNToadifferencesAccess数据库

    在MATLAB开发中,涉及到与外部数据库的交互时,数据源名称(DSN,Data Source Name)是一个关键概念。DSN是系统用来识别特定数据库连接的配置信息,它包括数据库的位置、类型以及用于连接的凭据。在本主题中,...

    MIT-BIH数据库MATLAB显示程序

    MIT-BIH数据库,在MATLAB上进行仿真,将数据库中原有的数据转换成十进制以仿真图的形式输出

    解包裹程序_matlab实现相位解包裹,matlab相位解包裹-数据库代码类资源

    最后,对于数据库代码类资源,这可能意味着这个MATLAB实现可以被集成到更大的数据处理系统中,如数据库查询结果的后处理或自动化分析流程。这要求代码具有良好的可扩展性和模块化设计,以便于与其他系统组件交互。 ...

    matlab开发-HeartVi1模拟数据库的重新同步

    在MATLAB开发环境中,"HeartVi1模拟数据库的重新同步"是一个关键的工程任务,尤其对于涉及生理信号处理或医学数据分析的应用来说。HeartVi1很可能是一个专门针对心脏生理信号(如心电图ECG)的仿真模型库。Simulink...

Global site tag (gtag.js) - Google Analytics