java命名空间java.sql接口databasemetadata的类成员方法:
gettables定义及介绍
本文导语:
gettables
resultset gettables(string catalog,
string schemapattern,
string tablenamepattern,
string[] types)
throws sqlexception
获取可在给定类别中使用的表的描述。仅返回与类别、模式、表...
gettables
resultset gettables(string catalog,
string schemapattern,
string tablenamepattern,
string[] types)
throws sqlexception
- 获取可在给定类别中使用的表的描述。仅返回与类别、模式、表名称和类型标准匹配的表描述。它们根据
table_type、table_cat、table_schem 和 table_name 进行排序。
每个表描述都有以下列:
- table_cat string => 表类别(可为
null)
- table_schem string => 表模式(可为
null)
- table_name string => 表名称
- table_type string => 表类型。典型的类型是 "table"、"view"、"system table"、"global temporary"、"local temporary"、"alias" 和 "synonym"。
- remarks string => 表的解释性注释
- type_cat string => 类型的类别(可为
null)
- type_schem string => 类型模式(可为
null)
- type_name string => 类型名称(可为
null)
- self_referencing_col_name string => 有类型表的指定 "identifier" 列的名称(可为
null)
- ref_generation string => 指定在 self_referencing_col_name 中创建值的方式。这些值为 "system"、"user" 和 "derived"。(可能为
null)
注: 有些数据库可能不返回用于所有表的信息。
- 参数:
catalog - 类别名称;它必须与存储在数据库中的类别名称匹配;该参数为 "" 表示获取没有类别的那些描述;为 null 则表示该类别名称不应该用于缩小搜索范围schemapattern - 模式名称的模式;它必须与存储在数据库中的模式名称匹配;该参数为 "" 表示获取没有模式的那些描述;为 null 则表示该模式名称不应该用于缩小搜索范围tablenamepattern - 表名称模式;它必须与存储在数据库中的表名称匹配types - 要包括的表类型所组成的列表,必须取自从 gettabletypes() 返回的表类型列表;null 表示返回所有类型
- 返回:
resultset - 每一行都是一个表描述
- 抛出:
sqlexception - 如果发生数据库访问错误- 另请参见:
getsearchstringescape()