繁体   English   中英

无法从结果集中的元数据中获取表名

[英]Trouble getting table name from meta data from result set

运行一些sql语句后,我从结果集中获得了一些元数据。 我想从元数据中获取表名。 我在用

Metadata.getTableName(1);

但是它什么也没有返回。 这意味着什么? 还要注意,我能够从元数据中成功获取列名,而不仅仅是表名。

您必须使用DatabaseMetaData md = connection.getMetaData();

从javadoc which retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection. The metadata includes information about the database's tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on. which retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection. The metadata includes information about the database's tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM