![]() |
VOOZH | about |
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 XML, you can use your XML 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 XML data. When you issue complex SQL queries to XML, the driver pushes supported SQL operations, like filters and aggregations, directly to XML 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 XML data using native data types.
This article shows how you can easily create an application that utilizes XML data in Mendix by combining the JDBC interface provided by Mendix with the CData JDBC Driver for XML.
In this section, we will explore how to develop an app using Mendix Studio Pro, as previously introduced, with XML data. Be sure to install Mendix Studio Pro beforehand.
First, install the CData JDBC Driver for XML on the same machine as Mendix. The JDBC Driver will be installed in the following path:
C:\Program Files\CData\CData JDBC Driver for XML 20xx\lib\cdata.jdbc.xml.jar
Now let's start creating the app. First, let's make an app that has the Database Connector available.
Next, add the Database Connector module to the app you just created.
To use the CData JDBC driver with this Database Connector, you must add the JDBC Driver JAR file to your project.
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.
Next, create a JDBC URL constant to use with the Database Connector.
Generate a JDBC URL for connecting to XML, beginning with jdbc:xml: followed by a series of semicolon-separated connection string properties.
CData Drivers let you work with XML files stored locally and stored in cloud storage services like Box, Amazon S3, Google Drive, or SharePoint, right where they are.
Set the URI property to local folder path.
To connect to XML file(s) within Amazon S3, set the URI property to the URI of the Bucket and Folder where the intended XML files exist. In addition, at least set these properties:
To connect to XML file(s) within Box, set the URI property to the URI of the folder that includes the intended XML file(s). Use the OAuth authentication method to connect to Box.
To connect to XML file(s) within Dropbox, set the URI proprerty to the URI of the folder that includes the intended XML file(s). Use the OAuth authentication method to connect to Dropbox. Either User Account or Service Account can be used to authenticate.
To connect to XML file(s) within SharePoint with SOAP Schema, set the URI proprerty to the URI of the document library that includes the intended XML file. Set User, Password, and StorageBaseURL.
To connect to XML file(s) within SharePoint with REST Schema, set the URI proprerty to the URI of the document library that includes the intended XML file. StorageBaseURL is optional. If not set, the driver will use the root drive. OAuth is used to authenticate.
To connect to XML file(s) within Google Drive, set the URI property to the URI of the folder that includes the intended XML file(s). Use the OAuth authentication method to connect and set InitiateOAuth to GETANDREFRESH.
The property is the controlling property over how your data is represented into tables and toggles the following basic configurations.
See the Modeling XML Data chapter for more information on configuring the relational representation. You will also find the sample data used in the following examples. The data includes entries for people, the cars they own, and various maintenance services performed on those cars.
For assistance in constructing the JDBC URL, use the connection string designer built into the XML JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.xml.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:xml:URI=C:/people.xml;DataModel=Relational;
Let's create a microflow that retrieves data from the Database Connector based on the entity we created.
Finally, let's create a screen that displays the results obtained from the microflow.
Now let's check if it works properly.
Download a free 30-day trial of the CData JDBC Driver for XML with Mendix, and effortlessly create an app that connects to XML data.
Reach out to our Support Team if you have any questions.
Download a free trial of the XML Driver to get started:
Download NowLearn more:
π XML Documents IconRapidly create and deploy powerful Java applications that integrate with XML data stores.