JDBC Driver for XML

Build 23.0.8839

XML データのモデリング

In this section we will show how to control the various schemes that the 本製品 offers to bridge the gap with relational SQL and XML services.The CData JDBC Driver for XML provides a managed way for you to use the two prevailing techniques for dealing with nested XML data:

  • Parsing the data structure and building a relational model based on the existing hierarchy.
  • Drilling down into the nested elements using horizontal and vertical flattening.

Parsing Hierarchical Data

By default, the 本製品 automatically detects the rows in a document, so that you do not need to know the structure of the XML to query it with SQL.Set the DataModel property to choose a basic configuration of how the 本製品 models the rows into tables.

Flattening Objects and Arrays into Rows

To flatten data, you only need to be familiar with two data structures:

  • Object:同じ階層で繰り返されない親要素。
  • Array:同じ階層で繰り返す要素。

people コレクションの次の例では、各ノードに子要素があるため、maintenance はオブジェクト配列です。

<maintenance>
  <date>07-17-2017</date>
  <desc>oil change</desc>
</maintenance>
<maintenance>
  <date>01-03-2018</date>
  <desc>new tires</desc>
</maintenance> 

自動スキーマ検出の設定

The 本製品 discovers columns and data types by scanning the RowScanDepth count of XML objects in XML arrays.Set the FlattenObjects and FlattenArrays properties to configure how nested data is flattened into columns; see 自動スキーマ検出 for examples.

XML へのSQL の実行

フラット化でアクセスできるあらゆるリレーションへは、アドホックなSQL クエリを使ってもアクセスが可能です。The 本製品 enables you to query nested data with the following capabilities:

  • 垂直フラット化:ネストされたオブジェクト配列に別のテーブルとしてアクセスします。
  • フリーフォームクエリ:どんなネストされた構造でもデータをフラット化せずにクエリできます
  • XML 関数:クライアント側の集計と変換を実行するために返されたデータを操作します。

スキーマのカスタマイズ

スキーマのカスタマイズ を使用すると、XML ドキュメントの上に選択されたリレーショナル構造を投射することもできます。これにより、カラム名、データ型、 ドキュメント内の値の位置を選択することができます。

システムカタログ

The システムテーブル reflect the schemas you configured, custom schemas or dynamically discovered.The Stored Procedures surface additional functionality in the 本製品's data processing operations that cannot be modeled as SELECT, INSERT, UPDATE, or DELETE.You can find the reported stored procedures defined in .rsb files in the folder specified by Location -- if Location is not specified, the db subfolder of the installation directory.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839