Ready to get started?

Learn more about the CData JDBC Driver for Dynamics 365 Business Central or download a free trial:

Download Now

Apache Spark でDynamics 365 Business Central Data をSQL で操作

CData JDBC ドライバーを使用して、Apache Spark でDynamics 365 Business Central Data にデータ連携。

Apache Spark は大規模データ処理のための高速で一般的なエンジンです。CData JDBC Driver for Dynamics 365 Business Central と組み合わせると、Spark はリアルタイムDynamics 365 Business Central data にデータ連携して処理ができます。ここでは、Spark シェルに接続してDynamics 365 Business Central data をクエリする方法について説明します。

CData JDBC Driver は、最適化されたデータ処理がドライバーに組み込まれているため、リアルタイムDynamics 365 Business Central data と対話するための高いパフォーマンスを提供します。Dynamics 365 Business Central に複雑なSQL クエリを発行すると、ドライバーはフィルタや集計など、サポートされているSQL操作を直接Dynamics 365 Business Central にプッシュし、組込みSQL エンジンを使用してサポートされていない操作(SQL 関数やJOIN 操作)をクライアント側で処理します。組み込みの動的メタデータクエリを使用すると、ネイティブデータ型を使用してDynamics 365 Business Central data を操作して分析できます。

CData JDBC Driver for Dynamics 365 Business Central をインストール

CData JDBC Driver for Dynamics 365 Business Central インストーラをダウンロードし、パッケージを解凍し、JAR ファイルを実行してドライバーをインストールします。

Spark Shell を起動してDynamics 365 Business Central Data に接続

  1. Open a terminal and start the Spark shell with the CData JDBC Driver for Dynamics 365 Business Central JAR file as the jars parameter: $ spark-shell --jars /CData/CData JDBC Driver for Dynamics 365 Business Central/lib/cdata.jdbc.d365businesscentral.jar
  2. With the shell running, you can connect to Dynamics 365 Business Central with a JDBC URL and use the SQL Context load() function to read a table.

    To authenticate to Dynamics 365 Business Central, you must provide the User and AccessKey properties.

    To obtain the User and AccessKey values, navigate to the Users page in Dynamics 365 Business Central and then click on Edit. The User Name and Web Service Access Key values are what you will enter as the User and AccessKey connection string properties. Note that the User Name is not your email address. It is a shortened user name.

    To connect to data, specify OrganizationUrl. If you have multiple companies in your organization, you must also specify the Company to indicate which company you would like to connect to. Company does not need to be specified if you have only one company.


    For assistance in constructing the JDBC URL, use the connection string designer built into the Dynamics 365 Business Central JDBC Driver.Either double-click the JAR file or execute the jar file from the command-line.

    java -jar cdata.jdbc.d365businesscentral.jar

    Fill in the connection properties and copy the connection string to the clipboard.

    scala> val d365businesscentral_df ="jdbc").option("url", "jdbc:d365businesscentral:OrganizationUrl=;").option("dbtable","Accounts").option("driver","cdata.jdbc.d365businesscentral.D365BusinessCentralDriver").load()
  3. Once you connect and the data is loaded you will see the table schema displayed.
  4. Register the Dynamics 365 Business Central data as a temporary table:

    scala> d365businesscentral_df.registerTable("accounts")
  5. Perform custom SQL queries against the Data using commands like the one below:

    scala> d365businesscentral_df.sqlContext.sql("SELECT accountid, Name FROM Accounts WHERE Name = MyAccount").collect.foreach(println)

    You will see the results displayed in the console, similar to the following:

Using the CData JDBC Driver for Dynamics 365 Business Central in Apache Spark, you are able to perform fast and complex analytics on Dynamics 365 Business Central data, combining the power and utility of Spark with your data.Download a free, 30 day trial of any of the 200+ CData JDBC Drivers and get started today.