Connect to Sage US Data in IntelliJ

Integrate connectivity to Sage US data with wizards in IntelliJ.

The CData JDBC Driver for Sage US enables you to access Sage US as a JDBC data source, providing integration with rapid development tools in IDEs. This article shows how to use the data source configuration wizard to connect to Sage US data in IntelliJ.

Create a JBDC Data Source for Sage US

Follow the steps below to add the driver JAR and define connection properties required to connect to Sage US data.

  1. In the Data Sources window, right-click and then click Add Data Source -> DB Data Source.
  2. In the Data Source Properties dialog that appears, the following properties are required:

    • JDBC Driver Files: Click the button next to this menu to add the JDBC Driver file cdata.jdbc.sage50us.jar, located in the installation directory.
    • JDBC Driver Class: In this menu, select cdata.jdbc.sage50us.Sage50USDriver from the list.
    • Database URL: Enter the connection URL in the JDBC URL property. The URL must start with jdbc:sage50us: and includes connection properties separated with semicolons.

      The Application Id and Company Name connection string options are required to connect to Sage as a data source. You can obtain an Application Id by contacting Sage directly to request access to the Sage 50 SDK.

      Sage must be installed on the machine. The Sage.Peachtree.API.dll and Sage.Peachtree.API.Resolver.dll assemblies are required. These assemblies are installed with Sage in C:\Program Files\Sage\Peachtree\API\. Additionally, the Sage SDK requires .NET Framework 4.0 and is only compatible with 32-bit applications. To use the Sage SDK in Visual Studio, set the Platform Target property to "x86" in Project -> Properties -> Build.

      You must authorize the application to access company data: To authorize your application to access Sage, restart the Sage application, open the company you want to access, and connect with your application. You will then be prompted to set access permissions for the application in the resulting dialog.

      While the compiled executable will require authorization only once, during development you may need to follow this process to reauthorize a new build. To avoid restarting the Sage application when developing with Visual Studio, click Build -> Configuration Manager and uncheck "Build" for your project.

      Built-in Connection String Designer

      For assistance in constructing the JDBC URL, use the connection string designer built into the Sage US JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

      java -jar cdata.jdbc.sage50us.jar

      Fill in the connection properties and copy the connection string to the clipboard.

      A typical JDBC URL is the following:

      jdbc:sage50us:ApplicationId=8dfafu4V4ODmh1fM0xx;CompanyName=Bellwether Garden Supply - Premium;

Edit and Save Sage US Data

To discover schema information, right-click the data source you just created and click Refresh Tables. To query a table, right-click it and then click Open Tables Editor. You can also modify records in the Table Editor.