Mendix, developed by Siemens, is a low-code platform used to rapidly develop, test, and deploy web and mobile applications, facilitating digital transformation and enhancing business agility. When paired with the CData JDBC Driver for Zuora, you can use your Zuora data to create various applications using Mendix Studio Pro.
With built-in optimized data processing, the CData JDBC driver offers
unmatched performance for interacting with live Zuora data. When you issue
complex SQL queries to Zuora, the driver pushes supported SQL operations,
like filters and aggregations, directly to Zuora and utilizes the embedded
SQL engine to process unsupported operations client-side (often SQL functions
and JOIN operations). Its built-in dynamic metadata querying allows you to work
with and analyze Zuora data using native data types.
This article shows how you can easily create an application that utilizes Zuora data in Mendix by combining the JDBC interface provided by Mendix with the CData JDBC Driver for Zuora.
Preparing the Mendix environment
In this section, we will explore how to develop an app using Mendix Studio Pro, as previously introduced, with Zuora data. Be sure to install Mendix Studio Pro beforehand.
Install the CData JDBC Driver for Zuora
First, install the CData JDBC Driver for Zuora on the same machine as Mendix. The JDBC Driver will be installed in the following path:
C:\Program Files\CData\CData JDBC Driver for Zuora 20xx\lib\cdata.jdbc.zuora.jar
Create an application
Now let's start creating the app. First, let's make an app that has the Database Connector available.
- Launch Mendix Studio Pro and click 'Create New App.'
π Create a new app
- Select the 'Blank Web App' option.
π Select the Blank Web App option
- Click 'Use this starting point' to proceed.
π Use this starting point
- Create an app with a name of your choice. Also, note down the "Disk location" information, for future reference.
π Name the app and note the disk location information
- You have now created a brand-new app.
π The app is now created
Add the Database Connector to your application
Next, add the Database Connector module to the app you just created.
- On the top right, click on the Marketplace button.
- Search for Database Connector in the Marketplace search section and select it.
π Search for the Database Connector from the marketplace
- Click on Download to download the latest Database Connector.
π Download the latest Database Connector
- In the Import Module window, select the Action as Add as a new module.
π Add a new module
π Module is successfully imported
- If the Database Connector appears on the app screen, you are good to move on to the next steps.
π Database connector is ready to be used
Adding the JDBC Driver to Mendix Studio Pro
To use the CData JDBC driver with this Database Connector, you must add the JDBC Driver JAR file to your project.
- In the Mendix project folder you noted earlier, there is a folder named 'userlib.' Place the two files, 'cdata.jdbc.zuora.jar' and 'cdata.jdbc.zuora.lic,' into that folder.
π Place the JAR and LIC files in the userlib folder of Mendix
- You can now use the CData JDBC Driver with the Database Connector.
Create a Data Model
Now, let's create an app. We first need to define a data model to load data from the Database Connector and display it on the list screen. Let's create the data model before loading the data.
- Add an Entity to the 'Domain model' of MyFirstModule.
π Add an entity
- Enter the entity name and field definitions.
π Add the entity name and field definitions
- You can easily configure the data by checking the table definition information through the CData JDBC driver using a tool such as DBeaver.
π Check and configure the data using any database administration tool
- Define the entities.
π Define the entities
Create a constant for the JDBC URL
Next, create a JDBC URL constant to use with the Database Connector.
- Add 'Constant' to MyFirstModule.
π Add a constant
- Add a name to the Constant in the Add Constant window.
π Add a name to the constant
Generate a JDBC URL for connecting to Zuora, beginning with jdbc:zuora: followed by a series of semicolon-separated connection string properties.
Zuora uses the OAuth standard to authenticate users. See the online Help documentation for a full OAuth authentication guide.
Configuring Tenant property
In order to create a valid connection with the provider you need to choose one of the Tenant values (USProduction by default) which matches your account configuration. The following is a list with the available options:
- USProduction: Requests sent to https://rest.zuora.com.
- USAPISandbox: Requests sent to https://rest.apisandbox.zuora.com"
- USPerformanceTest: Requests sent to https://rest.pt1.zuora.com"
- EUProduction: Requests sent to https://rest.eu.zuora.com"
- EUSandbox: Requests sent to https://rest.sandbox.eu.zuora.com"
Selecting a Zuora Service
Two Zuora services are available: Data Query and AQuA API. By default ZuoraService is set to AQuADataExport.
DataQuery
The Data Query feature enables you to export data from your Zuora tenant by performing asynchronous, read-only SQL queries.
We recommend to use this service for quick lightweight SQL queries.
Limitations
- The maximum number of input records per table after filters have been applied: 1,000,000
- The maximum number of output records: 100,000
- The maximum number of simultaneous queries submitted for execution per tenant: 5
- The maximum number of queued queries submitted for execution after reaching the limitation of simultaneous queries per tenant: 10
- The maximum processing time for each query in hours: 1
- The maximum size of memory allocated to each query in GB: 2
- The maximum number of indices when using Index Join, in other words, the maximum number of records being returned by the left table based on the unique value used in the WHERE clause when using Index Join: 20,000
AQuADataExport
AQuA API export is designed to export all the records for all the objects ( tables ). AQuA query jobs have the following limitations:
Limitations
- If a query in an AQuA job is executed longer than 8 hours, this job will be killed automatically.
- The killed AQuA job can be retried three times before returned as failed.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the Zuora JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.zuora.jar
Fill in the connection properties and copy the connection string to the clipboard.
π Using the built-in connection string designer to generate a JDBC URL (Salesforce is shown.)
A typical JDBC URL is below:
jdbc:zuora:OAuthClientID=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;Tenant=USProduction;ZuoraService=DataQuery;InitiateOAuth=GETANDREFRESH;
- Specify the connection string copied from the previous step in the Default value section and click on OK.
π Provide the connection string
Create a microflow to retrieve Zuora data
Let's create a microflow that retrieves data from the Database Connector based on the entity we created.
- Click 'Add microflow' from MyFirstModule.
π Click on Add microflow
- Create a microflow with any name.
π Create a microflow
- First, create an object for the entity you defined earlier. Then, add the 'Create Object' action to the microflow.
π Create an object
- Click on the 'Select' button for Entity in the Create Object window.
π Click on Select in create object window
- Select a previously defined Entity.
π Select the defined entity
- Enter an arbitrary Object name and click OK.
π Enter an object name
- Next, add an Execute Query action to the microflow to retrieve data from the Database Connector.
π Add an execute query action
- Define each input in the Execute Query window.
π Define each inputs for execute query
- In "jdbc url", specify the constant you defined beforehand.
π Specify the constant defined before
- In SQL, write a query to retrieve data from Zuora.
π Write a query to retrieve the data
- You don't need a Username or Password this time, so set them to 'empty' and assign the object created in the previous flow as the Result object. Then, simply specify any name you prefer for the List in the List Name section.
π Add any name to the list
- Finally, define the output of the microflow.
π Define the output of the microflow
- Double-click the End Event to open it, select 'List' from the Type dropdown, and link it to the Entity you defined earlier. Then, set the output result of Execute Query as the Return value.
π Link list to the entity
- This completes the microflow that retrieves data from Zuora.
π Microflow creation is complete
Create a list screen and link it to a microflow
Finally, let's create a screen that displays the results obtained from the microflow.
- Double-click 'Home_web' inside the Toolbox menu to open it.
π Open Home_web from toolbox menu
- Drag and drop a Data grid template from the Data containers section into the list screen.
π Drag and drop data grid template into the list screen
- Once you have placed the Data grid, double-click on it to display the Edit Data Grid settings screen.
π Open edit data grid to configure it
- Navigate to the Data source tab and link the data source type with the Microflow.
- Select the microflow you just created.
π Select the microflow
- Now click OK.
π Approve the microflow configuration
- When you click OK, you'll be prompted to auto-detect columns. Simply click 'Yes' to proceed.
π Click Yes for auto-detect columns
- Next, you'll be prompted to generate controllers for various Data grids. Since we won't be configuring the logic for each one this time, click 'No.'
π Click No to controllers for data grids
- This will create a simple data grid screen as shown below.
π Data grid screen is now created and ready to be used
Try it out
Now let's check if it works properly.
- Click the 'Publish' button to prepare the app you created. Once that's done, click 'View App' to open the app.
π Publish the app created
- If you see a list of Zuora data like the one below, you're all set! You've successfully created a Zuora-linked app with low code, without needing to worry about Zuora's API.
π See the list of Zuora data on the Mendix app screen
Get Started Today
Download a free 30-day trial of the CData JDBC Driver for Zuora with Mendix, and effortlessly create an app that connects to Zuora data.
Reach out to our Support Team if you have any questions.