製品をチェック

無償トライアル:

無償トライアルへ

製品の情報と無償トライアルへ:

Azure Data Lake Storage JDBC Driver

Azure Data Lake Storage データに連携するJava アプリケーションを素早く、簡単に開発できる便利なドライバー。

データ連携でお困りですか?

お問い合わせ

Mule アプリケーションからAzure Data Lake Storage データにアクセス:CData JDBC Driver


CData JDBC Driver for ADLS とHTTP、SQL を組み合わせれば、Azure Data Lake Storage データのJSON エンドポイントに接続できるMule アプリケーションを簡単に作成できます。


azuredatalake ロゴ画像
jdbc ロゴ画像

JDBC

MuleSoft Anypoint ロゴ画像

CData JDBC Driver for ADLS はAzure Data Lake Storage データをMule アプリケーションと連携することで、読みといった機能をおなじみのSQL クエリを使って実現します。JDBC ドライバーを使えば、Azure Data Lake Storage データをバックアップ、変換、レポート作成、分析するMule アプリケーションをユーザーは簡単に作成できます。

本記事では、Mule プロジェクト内でCData JDBC Driver for ADLS を使用して、Azure Data Lake Storage データのWeb インターフェースを作成する方法を紹介します。作成したアプリケーションを使えば、HTTP 経由でAzure Data Lake Storage データをリクエストして、JSON 形式で結果を取得できます。まったく同様の手順で、すべてのCData JDBC Driver で240 を超えるデータソースのWeb インターフェースを作成できます。手順は以下のとおりです。

  1. Anypoint Studio で新しいMule プロジェクトを作る。
  2. Message Flow にHTTP コネクタを追加する。
  3. HTTP コネクタのアドレスを設定する。 HTTP コネクタを追加・設定
  4. HTTP コネクタの追加後、Database Select コネクタを同じフローに追加する。
  5. データベースへの新しい接続を作成し(または既存の接続を編集し)、プロパティを設定する。
    • 接続を「Generic Connection」に設定
    • Required Libraries セクションでCData JDBC Driver のJAR ファイルを指定する(例:cdata.jdbc.adls.jar)。 JAR ファイルを追加(Salesforce の場合)。
    • Azure Data Lake Storage の接続文字列にURL を指定

      Authenticating to a Gen 1 DataLakeStore Account

      Gen 1 uses OAuth 2.0 in Azure AD for authentication.

      For this, an Active Directory web application is required. You can create one as follows:

      1. Sign in to your Azure Account through the .
      2. Select "Azure Active Directory".
      3. Select "App registrations".
      4. Select "New application registration".
      5. Provide a name and URL for the application. Select Web app for the type of application you want to create.
      6. Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
      7. Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.

      To authenticate against a Gen 1 DataLakeStore account, the following properties are required:

      • Schema: Set this to ADLSGen1.
      • Account: Set this to the name of the account.
      • OAuthClientId: Set this to the application Id of the app you created.
      • OAuthClientSecret: Set this to the key generated for the app you created.
      • TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
      • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

      Authenticating to a Gen 2 DataLakeStore Account

      To authenticate against a Gen 2 DataLakeStore account, the following properties are required:

      • Schema: Set this to ADLSGen2.
      • Account: Set this to the name of the account.
      • FileSystem: Set this to the file system which will be used for this account.
      • AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
      • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

      組み込みの接続文字列デザイナ

      JDBC 用のURL の作成にサポートが必要な場合は、Azure Data Lake Storage JDBC Driver に組み込まれた接続文字列デザイナを使用できます。JAR ファイルをダブルクリックするか、コマンドラインからJAR ファイルを実行してください。

      java -jar cdata.jdbc.adls.jar

      接続プロパティを入力して、接続文字列をクリップボードにコピーします。

    • Driver クラス名をcdata.jdbc.adls.ADLSDriver に指定します。 設定したデータベース接続(Salesforce の場合)。
    • 「接続テスト」をクリックします。
  6. SQL Query Text をAzure Data Lake Storage データをリクエストするためのSQL クエリに設定します。例えば、SELECT FullPath, Permission FROM Resources WHERE Type = 'FILE'Select オブジェクトを設定(Salesforce の場合)
  7. Transform Message コンポーネントをフローに追加します。
  8. Output スクリプトを次のように設定して、ペイロードをJSON に変換します。
    %dw 2.0
    output application/json
    ---
    payload
            
    Transform Message コンポーネントをフローに追加
  9. Azure Data Lake Storage データを閲覧するには、HTTP コネクタ用に設定したアドレスに移動します(デフォルトでは、localhost:8081):http://localhost:8081。Web ブラウザおよびJSON エンドポイントを使用可能な他のツール内で、Azure Data Lake Storage データをJSON として利用できます。

これで、カスタムアプリケーションおよび他のさまざまなBI、帳票、ETL ツールからAzure Data Lake Storage データを(JSON データとして)扱うための簡易なWeb インターフェースを作成できました。Mule アプリケーションからお好みのデータソースにアクセスできる、JDBC Driver for ADLS の30日の無償評価版のダウンロードはこちらから。