--- title: "Salesforce via SQL – Preparations" slug: "salesforce-sql-pre" updated: 2026-06-22T09:44:40Z published: 2026-06-22T09:44:40Z canonical: "docs.lobstersoftware.com/salesforce-sql-pre" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Salesforce via SQL – Preparations > [!NOTE] > Last Update: 2026-06-22 ## Overview This article covers JDBC-based SQL access to a Salesforce CRM system via Lobster Integration (requires version > 4.6.11). **NOTE:** This article does not cover Salesforce's native HTTP/SOAP interface. SQL access requires a paid add-on license. The CDATA JDBC driver, which is included with the license, must be installed. **WARNING:** The CDATA JDBC driver translates SQL statements from Lobster Integration into Salesforce HTTP/SOAP web service calls. Keep SQL statements simple ( no complex JOIN conditions). The more complex the statements, the higher the risk of translation failures. ## Salesforce Integration Two steps are required to enable SQL access to Salesforce via Lobster Integration: ### 1) JDBC Driver Once the license is activated, the JDBC driver appears automatically in the Update Center. After downloading the driver, restart the Integration Server once before proceeding. **Linux:** Restart the Integration Server. **Windows:** Follow this sequence: - Stop the Integration Server - Run ./bin/hub.bat - Terminate ./bin/hub.bat with Ctrl+C - Start the Integration Server See also: [Lobster Application Wrapper](/v1/docs/application-wrapper) for newer installations. **NOTE:** Check the Update Center regularly for driver updates. ### 2) Adding Database Aliases Two aliases are required because the JDBC driver cannot handle both bulk and non-bulk operations through a single alias. The bulk alias is used for Salesforce access in phase 5 (`SQLBulkUnit`). The non-bulk alias handles all other access (phases 1, 3, and 4). This separation prevents long-running SELECT statements from blocking bulk operations. Create aliases under **Configuration** > **Databases and Connectors**. The import templates below provide ready-to-use starting points. Alternatively, use **Templates** > **Templates (Presets)** > **Salesforce**. #### a) Bulk Alias ```ImportTemplate salesforce True jdbc:lobster:sforce2: (your salesforce login username) (your salesforce login password) Security Token (your security token) Use Bulk API true Bulk API Version v2 Logfile "C:\Lobster\IS\logs\salesforce_jdbc\sf.log" Verbosity 0   Max Log File Size 10MB             de.lobster.jdbc.jdbc.sforce.SForceDriver 0 0 300000 True True ``` | Parameter | Description | Example | | --- | --- | --- | | `alias` | Alias name. | `<Set name="alias">salesforce</Set>` | | `database` | Specifies the JDBC driver connection string. All parameters are declared in `database.xml` as `addNamedProperty` so they appear on the **JDBC Properties** tab after import. Additional properties can be added there as well. The connection string value is intentionally minimal; it only identifies the correct driver. | `<Set name="database">jdbc:lobster:sforce2:</Set>` (note the trailing `2` and colon) | | `user` | Salesforce login username. | `<Set name="user">(your salesforce login username)</Set>` | | `password` | Salesforce login password. | `<Set name="password">(your salesforce login password)</Set>` | | `Security Token` | A static security token generated in Salesforce. Salesforce emails the token to the user when the token is created or when the password is changed. A new token can be generated via View Profile > Settings > Reset My Security Token. The token does not expire automatically. | `<Call name="addNamedProperty">` `<Arg>Security Token</Arg>` `<Arg>(your security token)</Arg>` `</Call>` | | `Use Bulk API` | Enables the Salesforce Bulk API via the JDBC driver. Must be set to `true` in the bulk alias. | `<Call name="addNamedProperty">` `<Arg>Use Bulk API</Arg>` `<Arg>true</Arg>` `</Call>` | | `Bulk API Version` | Accepts v1 or v2. Defaults to v1. With v1, SELECT queries count toward the 15,000-batch daily limit, which can be exhausted quickly under load. Use v2 to avoid this. These jobs are processed first, which means a long-running **SELECT** can block other active jobs. This is why SELECT queries use the non-bulk alias, where `use Bulk API` is set to `false`. Direct object access bypasses job creation entirely. | `<Call name="addNamedProperty">` `<Arg>Bulk API Version</Arg>` `<Arg>v2</Arg>` `</Call>` | | `minSize, maxSize` | Must be `0` — otherwise Salesforce bulk jobs are not closed properly. | `<Set name="minSize">0</Set>` `<Set name="maxSize">0</Set>` | | `driver` | Java driver class. | `<Set name="driver">de.lobster.jdbc.jdbc.sforce.SForceDriver</Set>` | | `Use Connection Pooling` | Enables `ConnectionPooling` for the JDBC driver. For the bulk alias this must be `false` (the default), so the parameter can be omitted. When set to `true`, the driver attempts to append bulk data from two independent Lobster Integration jobs into a single Salesforce job for as long as the connection is held open. Because each profile runs until its Salesforce job completes, the second profile run fails with an error stating that new bulk data cannot be added to a closed Salesforce job. | | | `allowGrowing, catalogName, idleTime, sqlCommand, rollback, caching` | These parameters are not relevant for Salesforce aliases. They are present in every database alias by default. | | #### b) Non-Bulk Alias ```ImportTemplate                            salesforce_nobulk            True            jdbc:lobster:sforce2:Logfile="C:\Lobster\IS\logs\salesforce_jdbc\sf.log";Verbosity="3";Max Log File Size="10MB"            (your salesforce login username)            (your salesforce login password)                            Security Token                (your security token)                                        Use Bulk API                false                                        Use Connection Pooling                true                                    de.lobster.jdbc.jdbc.sforce.SForceDriver            0            0            300000                        True            True             ``` | Parameter | Description | Example | | --- | --- | --- | | `alias, database, user, passwort, Security Token, minSize, maxSize, driver` | See above. | | | `Use Bulk API` | Enables the Salesforce Bulk API via the JDBC driver. Must be set to `false` in the non-bulk alias. | `<Call name="addNamedProperty">` `<Arg>Use Bulk API</Arg>` `<Arg>false</Arg>` `</Call>` | | `Use Connection Pooling` | Enables JDBC driver connection pooling. Unlike the bulk alias, this must always be set to `true` — omitting it quickly exhausts the Salesforce limit of 3,000 connections per day. | `<Call name="addNamedProperty">` `<Arg>Use Connection Pooling</Arg>` `<Arg>true</Arg>` `</Call>` | | `allowGrowing, catalogName, idleTime, sqlCommand, rollback, caching` | See above. | | #### c) Accessing Other Salesforce Instances Production instances connect via `login.salesforce.com`, sandbox instances (clones of the production system) via `test.salesforce.com`. To target a sandbox, add the following JDBC property to the alias. The default for `Use Sandbox` is `false`: ```database    Use Sandbox    true ``` Salesforce also supports custom subdomains, e.g. `yourcompany.my.salesforce.com` To use a custom URL, add the `LoginURL` parameter. This applies to both production and sandbox. For sandbox, also set `Use Sandbox` to `true`. ```database    LoginURL    https://.my.salesforce.com/services/Soap/c/60.0 ``` **NOTE:** 60.0 is the Salesforce API version currently supported by the JDBC driver (as of 04/2024). #### d) Proxy Configuration Add all parameters to the alias via `addNamedProperty`. | Parameter | Description | Default | | --- | --- | --- | | `Proxy Server` | Proxy hostname or IP address. | ./. | | `Proxy Port` | TCP port the proxy listens on. | `80` | | `Proxy User` | Proxy authentication username. | ./. | | `Proxy Password` | Proxy authentication password. | ./. | | `Proxy Auth Scheme` | Authentication scheme (`BASIC`, `DIGEST`, `NEGOTIATE`, `PROPRIETARY`). | `BASIC` | | `Proxy Auto Detect` | Use system proxy settings. Set to false to enforce the explicitly configured proxy parameters. | `false` | | `Proxy Exceptions` | Semicolon-separated list of hostnames/IPs that bypass the proxy. | ./. | | `Proxy SSL Type` | `AUTO`, `ALWAYS`, `NEVER`, `TUNNEL` (see driver documentation). | `AUTO` | Further details in the driver documentation: [https://cdn.cdata.com/help/RFK/jdbc/Connection.htm](https://cdn.cdata.com/help/RFK/jdbc/Connection.htm) ## Configuring OAuth2+PKCE (Optional) **NOTE:** OAuth2+PKCE requires CData Salesforce driver version `25.0.9595.0` or later. This requirement applies to the driver only, independently of the **Lobster Data Platform** and the _data version. Prerequisites for using OAuth2+PKCE with the Salesforce JDBC driver: a) A connected app must be created in Salesforce. b) The Client ID (Consumer Key) and Client Secret (Consumer Secret) must be known. Refer to the official Salesforce documentation or consult your Salesforce administrator for details. Multiple steps are required to enable automatic token renewal. A Lobster Integration instance with existing Salesforce access via username/password authentication (as described above) is a prerequisite. Several procedures must be executed via the Admin Console or the SQL Console in the Plugins. The following steps walk through retrieving the initial access token and refresh token. **NOTE:** Do not skip any step as they are sequential dependencies. The initial token retrieval can be done through one alias, but all aliases must be configured for OAuth2 at the end. ### Step 1: Configure the Salesforce Alias Add the following properties to the Salesforce alias under **JDBC Properties**. The `CallbackURL` must be `http://localhost:33333` in both Salesforce and Lobster Integration. This is the standard callback URL for headless deployments. Replace all placeholders in square brackets with actual values. ```xml AuthScheme OAuth2PKCE    OAuthClientId    [Client Id(Consumer Key)]                    OAuthClientSecret    [Client Secret(Consumer Secret)]    CallbackURL    http://localhost:33333    InitiateOAuth    OFF    OAuthSettingsLocation    []/conf/Salesforce/OAuthSettings.txt    LoginURL    [LoginURL]    OAuthAccessTokenURL    [OAuthAccessTokenURL] ``` | Parameter | Description | Example | | --- | --- | --- | | `AuthScheme` | The authorization scheme the JDBC driver uses against Salesforce. For OAuth2+PKCE, set this to `OAuth2PKCE`. | | | `OAuthClientId` | Enter the Consumer Key (see Salesforce app settings). | `<Call name="addNamedProperty"> <Arg>OAuthClientId</Arg> <Arg>3MVG9Ve.2wqUVx_bR4rnWKR66zawe4q34aygrhQ1zCQ2LCVCj1JxSp.X_VyaCU4l1HjBLzvKzSAre.xK</Arg> </Call>` | | `OAuthClientSecret` | Enter the Consumer Secret (see Salesforce app settings). | `<Call name="addNamedProperty"> <Arg>OAuthClientSecret</Arg> <Arg>32913EEE7324357WERZT849D54FEE3C85E43F6C32751AD79818BDE4D</Arg></Call>` | | `CallbackURL` | The callback URL is required for the OAuth2 `Authorization Code` grant type. The authorization response is returned to this URL during token renewal. Because Lobster Integration is a server-side application without interactive user sessions, the localhost URL serves as a dummy redirect target. | | | `InitiateOAuth` | Specifies the OAuth initiation mode. During initial setup, use `OFF` — no valid tokens exist yet. After setup, change this to `REFRESH` since only token refresh is needed. The exact point at which to make this change is described below. | | | `OAuthSettingsLocation` | File path where the driver stores the current token. It is recommended to use a path under the `./conf` directory. | `<Call name="addNamedProperty"> <Arg>OAuthSettingsLocation</Arg> <Arg>/opt/Lobster/IS/conf/Salesforce/OAuthSettings.txt</Arg></Call>` | | `LoginURL` | Production system | `<Call name="addNamedProperty"> <Arg>LoginURL</Arg> <Arg>https://lobster--test.sandbox.my.salesforce.com</Arg></Call>` | | `OAuthAccessTokenURL` | The URL the driver uses to retrieve an access token. Varies by Salesforce instance type: Sandbox: `https://test.salesforce.com/services/oauth2/token` Production: `https://login.salesforce.com/services/oauth2/token` Custom domain: `https://<myCompany>.sandbox.my.salesforce.com/services/oauth2/token` | `<Call name="addNamedProperty"> <Arg>OAuthAccessTokenURL</Arg> <Arg>https://lobster--test.sandbox.my.salesforce.com/services/oauth2/token</Arg></Call>` | ### Step 2: Retrieve the Authorization URL and PKCE Verifier Start by retrieving the Salesforce authorization URL. Open the **Admin Console** and navigate to Tools > SQL Monitor. References to the **SQL Monitor** throughout this guide also apply to the **SQL Console** under **Plugins**. Use the Salesforce alias configured in Step 1. Execute the following command: `execute GetOAuthAuthorizationUrl` The response returns the Authorization URL and the PKCE verifier. Add the PKCE verifier as property `PKCEVerifier` to the Salesforce alias. The driver requires this value in Step 3. ```xml    PKCEVerifier    [PKCE-Verifier] ``` **Example:** | `https:``//login.salesforce.com/services/oauth2/authorize?state=aHR0cDovL2xvY2FsaG9zdDozMzMzMw%3D%3D&client_id=3MVG99Oxasdfasdfasdf0_eLiYU4FC2.NRn9htUmh2uIfNM.13BM33aZClit&response_type=code&redirect_uri=https%3A%2F%2Foauth.cdata.com%2Foauth%2F` | | --- | **NOTE:** The authorization URL is partially URL-encoded. Decode `%3D` at the end of the `state` value to `=`. In the example, `%3D%3D` becomes `==`. Do not decode the `redirect_uri` value. Open the Authorization URL in a browser. The browser does not need to run on the Integration Server host. The server responds with a redirect. The browser may show an error because `localhost:33333` does not exist, but this is expected. The redirect URL that appears in the browser address bar will look similar to this: | `http:``//localhost:33333/?code=YVByeDR5X0t6c2NXenl5easdfasdfkRmRyakxtNlNScEJNR2hFbG8wNTlJb2t2c1IzTVJ1UHU0Skg3aXdfYjMzYkRiM2NrZ1FZbWc9PQ==&state=YUhSMGNEb3ZMMnh2WTJGc2FHOXpkRG96TXpNek13PT0=&rssbus=true` | | --- | The value of the `code` parameter is the authorization code needed in the next step. In the example it is `YVByeDR5X0t6c2NXenl5easdfasdfkRmRyakxtNlNScEJNR2hFbG8wNTlJb2t2c1IzTVJ1UHU0Skg3aXdfYjMzYkRiM2NrZ1FZbWc9PQ==` ### Step 3: Retrieve the Access Token and Refresh Token Using the authorization code from Step 2, call the following stored procedure in the **SQL Monitor**: `execute GetOAuthAccessToken Verifier='<Authorization Code>'` This procedure returns a single-row result set. Extract the Access Token and Refresh Token values. ### Step 4: Store Tokens in the Alias Update the Salesforce alias under **Configuration** > **Databases/Connectors**. Add the Access Token and Refresh Token from Step 3, and change `InitiateOAuth` to `REFRESH`. ```xml    InitiateOAuth    REFRESH        OAuthAccessToken    [Access Token]    OAuthRefreshToken    [Refresh Token] ``` ## Logging ### Enabling Logging To enable JDBC driver logging, add the following parameters to the alias: ```database    Logfile    "C:\Lobster\IS\logs\salesforce_jdbc\sf.log"        Max Log File Size    "10MB"    Verbosity    0 ``` | Parameter | Description | | --- | --- | | `Logfile` | Absolute path to the log file. All parent directories must exist. | | `Verbosity` | Log level. Ranges from `1` (minimal) to `5` (very verbose). Defaults to `0` (disabled). | | `Max Log File Size` | Maximum log file size. When exceeded, the driver opens a new log file. | The log file contains a plain-text record of all exchanges between the JDBC driver and Salesforce (detail level depends on `Verbosity`). Both the generated SQL and the underlying HTTP request/response traffic are captured. For troubleshooting on a test system, `Verbosity` = 3 is typically sufficient. Disable logging once it is no longer needed. **WARNING:** On production systems, enable logging only with caution as log files can grow rapidly. The log file is created on the first database alias access, not at Integration Server startup. ### Log File Rollover When the `Max Log File Size` limit is reached, a rollover occurs. The current log file is renamed with a `yyyyMMddHH-mmss` timestamp, and a new log file (with the name specified in `Logfile`) is created. Subsequent log output goes to the new file. ## Salesforce Technical Notes The following sections describe Salesforce-specific technical characteristics relevant to JDBC-based integration. ### Metadata Cache On first access to a Salesforce object, the driver fetches the object's metadata and stores it in an internal cache (`MetaCache`). This speeds up subsequent accesses to the same object but means the cache must be rebuilt whenever the object schema changes (e.g., fields added or removed). Restart the Integration Server to force a full cache rebuild. ### Salesforce Bulk API Bulk jobs dramatically improve throughput for large-volume INSERT and UPDATE operations. Salesforce enforces per-day limits on connections and batch counts (dependent on the licensed edition), so bulk transfer is preferable for large datasets. **WARNING:** Salesforce bulk jobs are only created when the database alias has `use Bulk API = true` set **and** phase 5 uses the `SQLBulkUnit`. No bulk job is created when the alias has `use Bulk API= true` set, but the INSERT/UPDATE is performed by phase 3 (function) or phase 4 (database node). Using the `SQLBulkUnit` with an alias that has `use Bulk API= false` set produces a phase 5 error: `Got no salesforce job-ID`. In the Salesforce UI, navigate to Setup > Environments > Jobs > Bulk Data Load Jobs to view running and completed bulk jobs. A bulk job consists of 1–n batches, each containing 1–9,999 records (configurable via `SqlBulkUnit` – Max. SQL statements in batch). | | Attribute | Description | | --- | --- | --- | | Header data | `Job ID` `Object` `External ID Field` `Content Type` ... | Bulk job header data. | | Batch 1 | `Record 1` | First record in batch 1. | | `Record 2` | Second record in batch 1. | | ... | ... | | `Record 9999` | Last record in batch 1. | | Batch 2 | `Record 1` | First record in batch 2. | | `Record 2` | Second record in batch 2. | | ... | ... | Each database node in the **Lobster Data Platform** creates one Salesforce bulk job (even across multiple data sheets, the records from all sheets within a node are merged into a single job). Salesforce bulk jobs are processed sequentially by Lobster Integration. Individual batches within a bulk job are processed in parallel by Salesforce. **WARNING:** `delete before insert` cannot be used with the `SQLBulkUnit` in a Salesforce context. ### Objects and Fields Salesforce has standard objects (Type = `Standard Object`, provided out of the box, e.g. `Account`) and custom objects (Type = `Custom Object`). Each object has a label (displayed in the UI) and an API name (used for API access). Custom objects are identifiable by their API name suffix `__c`. Each object has one or more fields. Fields have a field label (for the UI) and a field name (for API access). Custom field names also end with `__c`. The Salesforce Object Manager (Setup > Object Manager) provides detailed schema information for all objects and their fields. Standard objects cannot be deleted, but additional fields and custom objects can be added. Standard fields cannot be deleted or modified. ### Object Relationships Salesforce supports two primary relationship types: Lookup and Master-Detail. Usage examples are covered in [Salesforce via SQL – Tutorial](/v1/docs/salesforce-sql). #### Lookup Relationship Lookup relationships are used when objects have a loose association. Standard object example: `Account` and `Contact`. A Contact is a loosely coupled entity that can be associated with an Account but can also exist independently. To associate a Contact with an Account, the `AccountId` field in Contact (of type `Lookup(Account)`) must be populated with the Account's internal ID. Once set, the Salesforce UI displays a navigation link from the Contact to the Account. #### Master-Detail Relationship In a Master-Detail relationship, the detail object has no independent existence as it is owned by the master. Deleting a master record cascades deletion to all associated detail records. The relationship field is always created on the detail object. No standard object example is available here because standard objects cannot act as detail objects in a Master-Detail relationship.