在运行一些sql语句之后,我从结果集中获得了一些元数据。我想从元数据中获取表名。我在用
Metadata.getTableName(1);但什么也回不来,这是什么意思?还请注意,我能够成功地从元数据中获取列名,而不是从表名。
发布于 2015-09-25 15:01:57
您必须使用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.
https://stackoverflow.com/questions/32785071
复制相似问题