Connect to JD Edwards Data as a Linked Server via SQL Gateway

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Use the SQL Gateway and the ODBC Driver to set up a linked server for JD Edwards data.

You can use the SQL Gateway to configure a TDS (SQL Server) remoting service and set up a linked server for JD Edwards data. After you have started the service, you can use the UI in SQL Server Management Studio or call stored procedures to create the linked server. You can then work with JD Edwards data just as you would a linked SQL Server instance.

Connect to JD Edwards as an ODBC Data Source

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.

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 the TDS Remoting Service

See the SQL Gateway Overview for a guide to configure a TDS remoting service in the SQL Gateway UI. The TDS remoting service is a daemon process that listens for TDS requests from clients.

Create a Linked Server for JD Edwards Data

After you have configured and started the daemon, create the linked server and connect. You can use the UI in SQL Server Management Studio or call stored procedures.

Create a Linked Server from the UI

Follow the steps below to create a linked server from the Object Explorer.

  1. Open SQL Server Management Studio and connect to an instance of SQL Server.
  2. In the Object Explorer, expand the node for the SQL Server database. In the Server Objects node, right-click Linked Servers and click New Linked Server. The New Linked Server dialog is displayed.
  3. In the General section, click the Other Data Source option and enter the following information after naming the linked server:
    • Provider: Select "Microsoft ODBC Driver for SQL Server" or "Microsoft OLE DB Driver for SQL Server"
    • Data Source: Enter the host and port the TDS remoting service is running on, separated by a comma.

      Note that a value of "localhost" in this input refers to the machine where SQL Server is running so be careful when creating a linked server in Management Studio when not running on the same machine as SQL Server.

    • Catalog:
      • Option 1: If you enabled the "Support multiple catalogs and schemas" option while creating and configuring the TDS Remoting Service in previous steps, enter CData as the catalog.
      • Option 2: For single schema support, enter the name of the data source's system DSN as CData JDEdwards Sys.
      Linked Server properties (Salesforce is shown)
    • In the Security section, select the option to have the connection "made using this security context" and enter the username and password of a user you created in the Users tab of the SQL Gateway. A user known to the daemon in the Linked Server security properties.

Create a Linked Server Programmatically

In addition to using the SQL Server Management Studio UI to create a linked server, you can use stored procedures. The following inputs are required:

  • server: The linked server name.
  • provider: Enter "MSOLEDBSQL", for the Microsoft OLE DB Driver for SQL Server.
  • datasrc: The host and port the service is running on, separated by a comma.

    Note that a value of "localhost" in the datasrc input refers to the machine where SQL Server is running, so be careful when creating a linked server in Management Studio when not running on the same machine as SQL Server.

  • catalog: Enter the system DSN configured for the service.
  • srvproduct: Enter the product name of the data source; this can be an arbitrary value, such as "CData SQL Gateway" or an empty string.
Follow the steps below to create the linked server and configure authentication to the SQL Gateway:
  1. Call sp_addlinkedserver to create the linked server:

    
    EXEC sp_addlinkedserver @server='JDEdwards',
      @provider='MSOLEDBSQL',
      @datasrc='< MachineIPAddress >,1434',
      @catalog='CData JDEdwards Sys',
      @srvproduct='';
    GO
    
  2. Call the sp_addlinkedsrvlogin stored procedure to allow SQL Server users to connect with the credentials of an authorized user of the service. Note that the credentials you use to connect to the service must specify a user you configured on the Users tab of the SQL Gateway.

    
    EXEC sp_addlinkedsrvlogin @rmtsrvname='JDEdwards',
      @rmtuser='admin',
      @rmtpassword='test',
      @useself='FALSE',
      @locallogin=NULL;
    GO
    

Connect from SQL Server Management Studio

SQL Server Management Studio uses the SQL Server Client OLE DB provider, which requires the ODBC driver to be used inprocess. You must enable the "Allow inprocess" option for the SQL Server Native Client Provider in Management Studio to query the linked server from SQL Server Management Studio. To do this, open the properties for the provider you are using under Server Objects -> Linked Servers -> Providers. Check the "Allow inprocess" option and save the changes.

Execute Queries

You can now execute queries to the JD Edwards linked server from any tool that can connect to SQL Server. Set the table name accordingly:


SELECT * FROM [linked server name].[CData JDEdwards Sys].[JDEdwards].[AccountsPayable.AccountLedger]
The result of a query in SQL Server Management Studio. (Salesforce is shown.)

Ready to get started?

Download a free trial of the JD Edwards ODBC Driver to get started:

 Download Now

Learn more:

JD Edwards Icon JD Edwards ODBC Driver

The JD Edwards ODBC Driver is a powerful tool that allows you to connect with live data from JD Edwards, directly from any applications that support ODBC connectivity.

Access JD Edwards data like you would a database - read JD Edwards AccountLedger, ProposalofPayment, ContractRevenueSummary, EmployeeEnrollment, RentIncreaseAmounts, etc. through a standard ODBC Driver interface.