製品をチェック

無償トライアル:

無償トライアルへ

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

Azure Analysis Services JDBC Driver

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

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

お問い合わせ

PowerBuilder からAzure Analysis Services データに連携


この記事では、Azure Analysis Services JDBC ドライバーを使用してPowerBuilder からAzure Analysis Services にアクセスする方法を説明します。


加藤龍彦
ウェブデベロッパー

CData JDBC Driver for AAS は、標準ベースのコントロールであり、PowerBuilder を含むJDBC をサポートするプラットフォームまたは開発テクノロジーから使用できます。 また、PowerBuilder でCData JDBC Driver for AAS を使用する方法についても詳しく説明します。

この記事では、CData JDBC Driver for AAS を使用してデータを取得し、基本的なPowerBuilder アプリケーションを作成する方法を説明します。

PowerBuilder からAzure Analysis Services データに接続

以下のステップに従ってDatabase Painter ツールを使用し、JDBC URL for AAS に基づいてデータベースプロファイルを作成します。データベースプロファイルを使用して、接続プロパティを保存できます。Ⅾatabase Painter では、データをグラフィカルに操作したり、SQL クエリを実行したりできます。

  1. ドライバーJAR をPowerBuilder クラスパスに追加します。CLASSPATH システム環境変数を、インストールディレクトリのlib サブフォルダにあるドライバーJAR へのパスに設定します。

    NotePowerBuilder Classic を使用している場合は、[Tools]->[System Options]->[Java]をクリックし、ドライバーJAR へのパスを追加することもできます。

  2. [Tools]->[Database Painter]と進みます。
  3. JDBC のノードを右クリックし、[New Profile]をクリックします。
  4. [Database Profile Setup]ダイアログで、以下を入力します。
    • Profile Name:プロファイルのわかりやすい名前を入力します。
    • Driver Name:ドライバーのクラス名にcdata.jdbc.aas.AASDriver を入力します。
    • URL:JDBC URL を入力します。

      To connect to Azure Analysis Services, set the Url property to a valid server, for instance, asazure://southcentralus.asazure.windows.net/server, in addition to authenticating. Optionally, set Database to distinguish which Azure database on the server to connect to.

      Azure Analysis Services uses the OAuth authentication standard. OAuth requires the authenticating user to interact with Azure Analysis Services using the browser. You can connect without setting any connection properties for your user credentials. See the Help documentation for more information.

      ビルトイン接続文字列デザイナ

      JDBC URL の構成については、Azure Analysis Services JDBC Driver に組み込まれている接続文字列デザイナを使用してください。JAR ファイルのダブルクリック、またはコマンドラインからJAR ファイルを実行します。

      java -jar cdata.jdbc.aas.jar

      接続プロパティを入力し、接続文字列をクリップボードにコピーします。以下は一般的なJDBC URL です。

      jdbc:aas:URL=asazure://REGION.asazure.windows.net/server;InitiateOAuth=GETANDREFRESH
    The JDBC data source defined in the Database Profile Setup dialog.(Salesforce is shown.)
  5. テーブルを表示および編集するには、テーブルを右クリックして[Edit Data]->[Grid]をクリックします。
Modify database objects in the Database Painter.(Salesforce is shown.)

Azure Analysis Services をPowerBuilder Controls と共に使用する

標準のPowerBuilder オブジェクトを使用してJDBC データソースに接続し、クエリを実行できます。以下の例は、Azure Analysis Services をDataWindowに取得する方法を示しています。次のコードをopen メソッドに追加できます。

SQLCA.DBMS = "JDBC" SQLCA.AutoCommit = False SQLCA.DBParm = "Driver='cdata.jdbc.aas.AASDriver',URL='jdbc:aas:URL=asazure://REGION.asazure.windows.net/server;InitiateOAuth=GETANDREFRESH"; CONNECT USING SQLCA; dw_customer.SetTransObject(SQLCA); dw_customer.Retrieve();