Replicate Multiple JD Edwards Accounts via the CData Sync CLI
CData Sync for JD Edwards is a stand-alone application that provides solutions for a variety of replication scenarios such as replicating sandbox and production instances into your database. Both Sync for Windows and Sync for Java include a command-line interface (CLI) that makes it easy to manage multiple JD Edwards connections. In this article we show how to use the CLI to replicate multiple JD Edwards accounts.
Configure JD Edwards Connections
You can save connection and email notification settings in an XML configuration file. To replicate multiple JD Edwards accounts, use multiple configuration files. Below is an example configuration to replicate JD Edwards to SQLite:
Windows
<?xml version="1.0" encoding="UTF-8" ?>
<CDataSync>
<DatabaseType>SQLite</DatabaseType>
<DatabaseProvider>System.Data.SQLite</DatabaseProvider>
<ConnectionString>URL=https://your-jde-environment-app.example.com;User=admin;Password=myPassword;</ConnectionString>
<ReplicateAll>False</ReplicateAll>
<NotificationUserName></NotificationUserName>
<DatabaseConnectionString>Data Source=C:\my.db</DatabaseConnectionString>
<TaskSchedulerStartTime>09:51</TaskSchedulerStartTime>
<TaskSchedulerInterval>Never</TaskSchedulerInterval>
</CDataSync>
Java
<?xml version="1.0" encoding="UTF-8" ?>
<CDataSync>
<DatabaseType>SQLite</DatabaseType>
<DatabaseProvider>org.sqlite.JDBC</DatabaseProvider>
<ConnectionString>URL=https://your-jde-environment-app.example.com;User=admin;Password=myPassword;</ConnectionString>
<ReplicateAll>False</ReplicateAll>
<NotificationUserName></NotificationUserName>
<DatabaseConnectionString>Data Source=C:\my.db</DatabaseConnectionString>
</CDataSync>
The driver connects to JD Edwards through your Application Interface Services (AIS) Server. Set the following connection properties:
- URL: The base HTTPS URL of your AIS Server (e.g., https://jde-ais.example.com:8300).
- User: Your JD Edwards username.
- Password: Your JD Edwards password.
- Environment (optional): The JD Edwards environment to use (e.g., PD920 for production or DV920 for development). If not specified, the AIS Server's default environment is used.
- Role (optional): The JD Edwards role for the session. If not specified, the AIS Server's default role is used.
- DeviceName (optional): An identifier for the connecting device or application, used for auditing and logging on the AIS Server.
- Jasserver (optional): The specific Java Application Server (JAS) instance to route requests through, useful in clustered environments.
Choosing Which Data Is Exposed
JD Edwards organizes tables and business views by System Code, and the driver exposes each System Code as its own schema. Use these properties to control which schemas are available:
- DataModel: One or more ERP modules (comma-separated) whose System Codes are exposed as schemas, or All to expose every System Code in the connected instance. Defaults to FinancialManagement.
- SystemCodes: A comma-separated list of additional System Codes to expose alongside those from DataModel (e.g., 42,43).
When you connect, the driver sends your credentials to the AIS Server to obtain a session token and caches it. The driver requests a new token automatically before the session expires.
Configure Queries for Each JD Edwards Instance
Sync enables you to control replication with standard SQL. The REPLICATE statement is a high-level command that caches and maintains a table in your database. You can define any SELECT query supported by the JD Edwards API. The statement below caches and incrementally updates a table of JD Edwards data:
REPLICATE AccountsPayable.AccountLedger;
You can specify a file containing the replication queries you want to use to update a particular database. Separate replication statements with semicolons. The following options are useful if you are replicating multiple JD Edwards accounts into the same database:
You can use a different table prefix in the REPLICATE SELECT statement:
REPLICATE PROD_AccountsPayable.AccountLedger SELECT * FROM AccountsPayable.AccountLedger
Alternatively, you can use a different schema:
REPLICATE PROD.AccountsPayable.AccountLedger SELECT * FROM AccountsPayable.AccountLedger
Run Sync
After you have configured the connection strings and replication queries, you can run Sync with the following command-line options:
Windows
JDEdwardsSync.exe -g MyProductionJDEdwardsConfig.xml -f MyProductionJDEdwardsSync.sql
Java
java -Xbootclasspath/p:c:\sqlitejdbc.jar -jar JDEdwardsSync.jar -g MyProductionJDEdwardsConfig.xml -f MyProductionJDEdwardsSync.sql