Connect to Sage X3 Cloud Data in CloverDX (formerly CloverETL)
The CData JDBC Driver for Sage X3 Cloud enables you to use the data transformation components in CloverDX (formerly CloverETL) to work with Sage X3 Cloud as sources. In this article, you will use the JDBC Driver for Sage X3 Cloud to set up a simple transfer into a flat file. The CData JDBC Driver for Sage X3 Cloud enables you to use the data transformation components in CloverDX (formerly CloverETL) to work with Sage X3 Cloud as sources. In this article, you will use the JDBC Driver for Sage X3 Cloud to set up a simple transfer into a flat file.
Connect to Sage X3 Cloud as a JDBC Data Source
- Create the connection to Sage X3 Cloud data. In a new CloverDX graph, right-click the Connections node in the Outline pane and click Connections -> Create Connection. The Database Connection wizard is displayed.
- Click the plus icon to load a driver from a JAR. Browse to the lib subfolder of the installation directory and select the cdata.jdbc.sagex3cloud.jar file.
- Enter the JDBC URL.
Sage X3 Cloud uses the OAuth 2.0 Client Credentials flow, and an X-API-Key is also required for API access. Set AuthScheme to OAuth and specify the following connection properties:
- URL: The base URL of your Sage X3 Cloud instance.
- OAuthAccessTokenUrl: The OAuth token endpoint (e.g., https://your-auth-domain/oauth/token).
- OAuthClientId: Your OAuth application client ID.
- OAuthClientSecret: Your OAuth application client secret.
- Audience: The API audience value for the token request.
- XAPIKey: The X-API-Key provided by your Sage X3 Cloud administrator.
- Folder: The Sage X3 folder name (e.g., SEED). This folder is used as the default schema.
- Folders (optional): A comma-separated list of Sage X3 folders (e.g., SEED,PERF). Each folder is exposed as a separate schema, so you can query across folders with the Schema.Table syntax.
The driver obtains an access token with the Client Credentials flow and sends it with the X-API-Key on every API request. With InitiateOAuth set to GETANDREFRESH (the default), the driver acquires and refreshes the token automatically.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the Sage X3 Cloud JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.sagex3cloud.jarFill in the connection properties and copy the connection string to the clipboard.
A typical JDBC URL is below:
jdbc:sagex3cloud:AuthScheme=OAuth;URL=https://x3server/;OAuthAccessTokenUrl=https://auth-domain/oauth/token;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;Audience=https://api-audience;XAPIKey=your_api_key;Folder=SEED;
Query Sage X3 Cloud Data with the DBInputTable Component
- Drag a DBInputTable from the Readers selection of the Palette onto the job flow and double-click it to open the configuration editor.
- In the DB connection property, select the Sage X3 Cloud JDBC data source from the drop-down menu.
- Enter the SQL query. For example:
SELECT BPCNUM, BPCNAM FROM BPCUSTOMER WHERE BPCNUM = 'MARTIN'
Write the Output of the Query to a UniversalDataWriter
- Drag a UniversalDataWriter from the Writers selection onto the jobflow.
- Double-click the UniversalDataWriter to open the configuration editor and add a file URL.
- Right-click the DBInputTable and then click Extract Metadata.
- Connect the output port of the DBInputTable to the UniversalDataWriter.
- In the resulting Select Metadata menu for the UniversalDataWriter, choose the BPCUSTOMER table. (You can also open this menu by right-clicking the input port for the UniversalDataWriter.)
- Click Run to write to the file.