Announcements
Setting Up the JDBC Driver
Business Use Cases
Revenue Field Guide and Calculation Logic
B2C Commerce Platform Release Notes
Ask the Community
This section describes how to configure your JDBC driver and connect it to the B2C Commerce Data Lakehouse. The B2C Commerce Data Lakehouse is a centralized data repository that stores and organizes B2C Commerce Cloud transactional data, customer interactions, and business metrics in a structured format optimized for analytics and reporting. It serves as the foundation for the Commerce Intelligence JDBC Driver, providing access to pre-aggregated business data through standardized SQL queries.
The data lakehouse contains:
This architecture enables business users to perform complex analytics on e-commerce data, supporting use cases like sales analytics, customer behavior analysis, inventory optimization, and marketing campaign effectiveness measurement.
The Commerce Intelligence JDBC Driver enables seamless connectivity to your B2C Commerce data lakehouse through a JDBC interface, ensuring compatibility with various SQL editors and data visualization tools.
There are two ways to download the Commerce Intelligence JDBC Driver:
Download the latest version directly from the Salesforce Commerce Cloud GitHub Repository. For detailed installation steps, refer to the README file in the repository.
Authentication steps may be required to access the repository. This documentation will be updated with detailed instructions on how to authenticate and download the driver.
Note
Include the driver as a Maven dependency in your Java project. This is helpful if you're building a custom application and want to manage dependencies via Maven.
Add the following to your pom.xml:
<dependency>
<groupId>com.salesforce.commerce.intelligence.jdbc.client</groupId>
<artifactId>cip-client-dataconnector</artifactId>
<version>[VERSION]</version> <!-- Replace with the latest version -->
</dependency>Find the latest version on Maven Repository.
For demonstration purposes, this document uses DBeaver as an example SQL editor. However, the Commerce Intelligence JDBC Driver is compatible with any JDBC-compliant tool, such as SQL Workbench, DataGrip, or custom Java applications.
To use the driver in DBeaver:
com.salesforce.commerce.intelligence.jdbc.client.CIPDriver.A JDBC Driver connection enables you to access analytics data used for Reports and Dashboards. It doesn't establish a connection to your B2C commerce instance or to Business Manager, and it can't be used to modify your live site.
Note
The following properties must be configured to connect to your B2C Commerce data lakehouse:
| Property | Description | Type | Required | Example |
|---|---|---|---|---|
| JDBC URL | Specifies the B2C Commerce database connection string, including the target instance. Replace the {your_instance_id} placeholder with your actual TenantId, which uniquely identifies your tenant's data environment. | String | Yes | jdbc:salesforcecc://jdbc.analytics.commercecloud.salesforce.com:443/{your_instance_id} |
| Username | The Client ID provided by your Account Manager. | String | Yes | your-client-id |
| Password | The Client Secret provided by your Account Manager. | String | Yes | your-client-secret |
Starting with B2C Commerce release 26.1, you can connect the B2C Commerce Intelligence JDBC Driver to non-production B2C Commerce environments. Supported non-production instances include:
To use the JDBC driver with a non-production instance, turn on the Enable Reports & Dashboards Data Tracking feature switch in Business Manager. For instructions, see Set Feature Switches (Toggles) in B2C Commerce. After turning on the feature switch, wait up to 2 hours for provisioning to complete.
For non-production environments, use the non-production JDBC URL instead of the production URL:
| Environment | JDBC URL |
|---|---|
| Production | jdbc:salesforcecc://jdbc.analytics.commercecloud.salesforce.com:443/{your_instance_id} |
| Non-Production | jdbc:salesforcecc://jdbc.stg.analytics.commercecloud.salesforce.com:443/{your_instance_id} |
Replace {your_instance_id} with your actual instance identifier (for example, bjnl_dev or bjnl_stg).
The Real-Time Performance dashboard and Einstein Dashboard data are not available for non-production instances.
Note
You can also use the Commerce Intelligence JDBC Driver directly in your Java applications. The following sample code demonstrates how to connect and query your B2C Commerce data:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class JDBCExample {
public static void main(String[] args) {
String jdbcUrl = "jdbc:salesforcecc://jdbc.analytics.commercecloud.salesforce.com:443/bjnl_prd"; // Replace with your actual JDBC URL
String username = "your-client-id"; // Replace with your Client ID
String password = "your-client-secret"; // Replace with your Client Secret
try {
// Load the JDBC driver explicitly
Class.forName("com.salesforce.commerce.intelligence.jdbc.client.CIPDriver");
try (Connection connection = DriverManager.getConnection(jdbcUrl, username, password)) {
System.out.println("Connection established successfully!");
String query = "SELECT * FROM your_table_name"; // Replace with your actual query
try (PreparedStatement preparedStatement = connection.prepareStatement(query);
ResultSet resultSet = preparedStatement.executeQuery()) {
while (resultSet.next()) {
System.out.println("Column 1: " + resultSet.getString(1));
System.out.println("Column 2: " + resultSet.getString(2));
// Add more columns as needed
}
}
}
} catch (ClassNotFoundException e) {
System.err.println("JDBC Driver not found. Ensure the Commerce Intelligence Driver JAR is in the classpath.");
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}Keep the following best practices in mind when issuing queries to Commerce Cloud:
SELECT * FROM <TABLE> against tables with thousands of rows.SELECT * in JDBC queries. List only the columns you need so that queries remain stable when table schemas change.LOWER() to normalize search terms in SQL and make results match SFCC dashboards.The following non-functional limits and behaviors apply when using the B2C Commerce Intelligence connector. Please review these carefully to avoid unexpected errors or interruptions:
Here are some sample queries:
--
-- Sales Trend Query
--
SELECT
"submit_date",
SUM("num_orders") AS orders,
SUM("num_units") AS units,
SUM("std_revenue") AS gmv,
SUM("std_total_discount") AS discounts,
SUM("std_shipping") AS shipping,
SUM("std_tax") AS tax
FROM
"ccdw_aggr_sales_summary"
WHERE
"submit_date" between ? AND ?
GROUP BY "submit_date"
ORDER BY "submit_date" DESC---
--- Geography Analysis (Shipping Region)
---
SELECT
g."region_name" AS region,
SUM(quantity) AS units
FROM
"ccdw_fact_line_item" AS li,
"ccdw_dim_geography" AS g
WHERE
li."shipping_geography_id" = g."region_id" AND
li."utc_submit_timestamp" between ? AND ?
GROUP BY g."region_name"---
--- Top Search Terms (Conversion)
---
SELECT
sc."query" AS query,
SUM(sc."num_searches") AS searches,
SUM(sc."num_orders") AS search_orders,
SUM(sc."std_revenue") AS search_gmv
FROM
"ccdw_aggr_search_conversion" sc
WHERE
sc."search_date" between ? AND ?
GROUP BY sc."query"
ORDER BY 2 DESCWhy do my custom queries give different results than the standard CC Reports and Dashboards (CCAC) reports?
When analyzing search data, you might see discrepancies when comparing results from the data warehouse tables accessed via the JDBC driver and reports viewed in CC Reports and Dashboards (CCAC). If you attempt to reproduce a specific CCAC report metric using a direct table query, be aware that your results might not align with the dashboard figures due to underlying proprietary logic. We recommend using established table definitions for custom reporting while acknowledging that reproducing proprietary dashboard metrics is not supported.
Is there any difference in data availability (time) in Reports and Dashboards vs via JDBC driver?
No. Data will be available at the same time in Reports and Dashboards as well as JDBC driver.
Do you plan to make more data available for access through JDBC driver?
Yes, more information will be shared closer to release time.