Retrieving table metadata
The JDBC Metadata Explorer enables the retrieval of different database table metadata (name, type etc.); you can narrow the search by specifying catalog, schema, and table name.
Input
Add the element <tablemetadata resulttag="Result element name"/> to an input XML document with any root element, and specify a valid XML name within the attribute resulttag. The specification of catalog, schema, and table within the elements <catalog>, <schema>, and <table> are optional here; if these are not specified, all available metadata will be retrieved.
<Root>
<tablemetadata resulttag="ResultElementName">
<catalog>Catalog</catalog>
<schema>Database schema</schema>
<table>Database table</table>
</tablemetadata>
</Root>
Output
The output XML structure contains the root element <Data> with a child element whose name has been specified in the input structure within the attribute resulttag. It contains table metadata. If there are multiple result sets (i. e. more than one table or view), each will be output in a separate element.
<Data>
<ResultElementName>
<Table property> value </Table property>
...
</ResultElementName>
</Data>
Further information on each table property can be found here.
Example
An input XML document contains the following XML structure to output metadata for a table HISTORY in a database schema APP:
<Root>
<tablemetadata resulttag="DBTable">
<catalog></catalog>
<schema>APP</schema>
<table>HISTORY</table>
</tablemetadata>
</Root>
Then, the JDBC Metadata Explorer outputs e. g. the following result XML document:
<Data>
<DBTable>
<TABLE_CAT />
<TABLE_SCHEM>APP</TABLE_SCHEM>
<TABLE_NAME>HISTORY</TABLE_NAME>
<TABLE_TYPE>TABLE</TABLE_TYPE>
<REMARKS />
<TYPE_CAT isNull="true" />
<TYPE_SCHEM isNull="true" />
<TYPE_NAME isNull="true" />
<SELF_REFERENCING_COL_NAME isNull="true" />
<REF_GENERATION isNull="true" />
</DBTable>
</Data>