JDBC Driver for SugarCRM

Build 22.0.8462

Establishing a Connection

Creating a JDBC Data Source

You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for SugarCRM consists of three basic steps:

  • Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
  • Provide the driver class. For example:
    cdata.jdbc.sugarcrm.SugarCRMDriver
  • Provide the JDBC URL. For example:
    jdbc:sugarcrm:InitiateOAuth=GETANDREFRESH;URL=http://mySugarCRM.com;User=myUser;Password=myPassword;
    
    or
    
    jdbc:cdata:sugarcrm:InitiateOAuth=GETANDREFRESH;URL=http://mySugarCRM.com;User=myUser;Password=myPassword;

    The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:sugarcrm:" or "jdbc:cdata:sugarcrm:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to SugarCRM

Specify the following to establish a connection to SugarCRM:

  • URL: Set this to the URL associated with the SugarCRM account in the form 'http://{sugar crm instance}.com'.
  • Platform: If you're encountering a login conflict during authentication, set this to one of the platforms that you have created in the SugarCRM UI.

Authenticating to SugarCRM

To authenticate the driver to SugarCRM, the following must be set to valid SugarCRM user credentials:

  • User: The user of the SugarCRM account.
  • Password: The password of the SugarCRM account.

By default, SugarCRM uses "sugar" client id for authentication, but user can specify client id and client secret values of a custom app:

  • OAuthClientId: Client id value of your app.
  • OAuthClientSecret: Client secret value of your app.

Note that retrieving SugarCRM metadata can be expensive. It is advised that you store the metadata locally as described in Caching Metadata.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462