X4 Produktdokumentation

Retrieving database metadata 1

The JDBC Metadata Explorer enables the retrieval of different database metadata (vendor/product name, supported functions, etc.) and the retrieval of existing schemas from the database that is connected via JDBC.


Input

Add the element <databasemeta resulttag="Result element name"/> to an input XML document with any root element, and specify a valid XML name within its attribute resulttag.

<Root>
  <databasemeta resulttag="Result element name"/>
</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 schema information and database metadata:

<Data>
   <ResultElementName key="value" ...>
   <Schema>
      <TABLE_SCHEM>DB-Schema</TABLE_SCHEM>
      <TABLE_CATALOG isNull="(true/false)" />
   </Schema>
   ...
   </ResultElementName>
</Data>

Example

An input XML document contains the following XML structure to output metadata for the connected database:

<RootElement>
   <databasemeta resulttag="DB"/>
</RootElement>


Then, the JDBC Metadata Explorer outputs e. g. the following result XML document:

<Data>
   <DB product-name="Apache Derby" readOnly="false"
      supports-stored-procedures="true" supports-batch-updates="true"
      all-tables-are-selectable="true" supports-outer-joins="true"
      supports-convert="true" supports-group-by="true">
      <Schema>
         <TABLE_SCHEM>APP</TABLE_SCHEM>
         <TABLE_CATALOG isNull="true" />
      </Schema>
      ...
   </DB>