This section describes how to create a JDBC data source for Microsoft Dynamics 365 Business Central data and execute queries.
Add the JDBC Driver for Microsoft Dynamics 365 Business Central
Complete the following steps to add the driver .jar file:
- In the Drivers pane, click the plus icon to open the Add Driver wizard.
- In the Name box, enter a user-friendly name for the driver; for example, CData JDBC Driver for Microsoft Dynamics 365 Business Central.
- In the Example URL box, enter jdbc:d365businesscentral:
- In the Extra Class Path tab, click Add.
- In the file explorer that opens, select the .jar file for the driver, located in the lib subfolder of the installation directory.
- Click List Drivers to populate the Class Name menu with the class name for the driver, cdata.jdbc.d365businesscentral.D365BusinessCentralDriver.
Create the JDBC Data Source
Complete the following steps to select the Microsoft Dynamics 365 Business Central driver you created and build the JDBC URL to create the JDBC data source:
- In the Aliases pane, click the plus icon.
In the Add Alias wizard that opens, provide values for the following fields:
- Name: Enter a name for the alias; for example, CData Microsoft Dynamics 365 Business Central Source.
- Driver: Select the driver definition you created.
- URL: Enter jdbc:d365businesscentral:
- User Name: If needed, enter a user name for authentication, which is added to the JDBC URL.
- Password: If needed, enter a password for authentication, which is added to the JDBC URL.
- If you want to define any additional properties, add them to the JDBC URL in a semicolon-separated list.
The following is a typical connection string:
jdbc:d365businesscentral:InitiateOAuth=GETANDREFRESH;OrganizationUrl=https://api.businesscentral.dynamics.com/v1.0/api/v1.0See Establishing a Connection for a connection and authentication guide.
- Select the Use Driver Properties check box.
- In the Specify column, select the check boxes for the required connection properties and specify the corresponding values.
- In the dialog that appears after you click OK, click Connect to test the connection.
Discover Schemas and Query Microsoft Dynamics 365 Business Central Data
To connect to the data source, right-click the alias on the Aliases pane and then click Connect. After the metadata has loaded, a new tab for the Microsoft Dynamics 365 Business Central data source is displayed. On the Objects subtab, you can discover schema information, such as the available tables and views.
To view table data and metadata, select the table on the Objects tab. Access the table data on the Content tab.
To execute an SQL query, enter the query on the SQL tab and then click Run SQL (the runner icon).