请教DatabaseMetaData.getTables()方法中各参数的含义,严重谢!
下面是JDK doc的讲解,在下看不懂,恳请高手指教!最好能举个例子。谢!
public ResultSet getTables(String catalog,
String schemaPattern,
String tableNamePattern,
String[] types)
throws SQLException
Retrieves a description of the tables available in the given catalog. Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
Parameters:
catalog - a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
schemaPattern - a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
tableNamePattern - a table name pattern; must match the table name as it is stored in the database
types - a list of table types to include; null returns all types
public ResultSet getTables(String catalog,
String schemaPattern,
String tableNamePattern,
String[] types)
throws SQLException
Retrieves a description of the tables available in the given catalog. Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
Parameters:
catalog - a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
schemaPattern - a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
tableNamePattern - a table name pattern; must match the table name as it is stored in the database
types - a list of table types to include; null returns all types
...全文
相关推荐
java 查询oracle数据库所有表DatabaseMetaData的用法(详解)
在实际使用时,确保参数名使用大写,否则可能无法获取正确的数据。第三部分是`getColumns()`方法,用于获取指定表的列信息。
关于Mysql8.0版本驱动getTables返回所有库的表问题浅析
在MySQL数据库的使用中,有时候我们可能会遇到这样一个问题:当使用MySQL Connector/J 8.0版本的驱动执行`DatabaseMetaData.getTables()`方法时,它会返回所有数据库的表
java判断数据库表是否存在
#### 3. getTables方法`getTables`方法用于检索特定模式下的所有表的信息,参数包括:- `String catalog`: 数据库名称。
判断数据库表是否存在以及修改表名的方法
e) { e.printStackTrace(); } return result;}```在这个方法中,`getTables()`方法的四个参数分别代表catalog(数据库名)、schema(模式或所有者
浅谈 JDBC 元数据
例如,getTables() 方法可以获取数据库中的所有表,getColumnNames() 方法可以获取 ResultSet 对象中的列名,getColumnCount() 方法可以获取 ResultSet


