{"id":28828949,"url":"https://github.com/forcedotcom/datacloud-jdbc","last_synced_at":"2026-02-05T18:02:45.948Z","repository":{"id":263682745,"uuid":"884436479","full_name":"forcedotcom/datacloud-jdbc","owner":"forcedotcom","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-22T09:50:57.000Z","size":1251,"stargazers_count":15,"open_issues_count":17,"forks_count":12,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-01-23T00:24:41.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forcedotcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-06T18:43:55.000Z","updated_at":"2026-01-22T09:50:36.000Z","dependencies_parsed_at":"2024-11-20T03:30:49.056Z","dependency_job_id":"a4250763-1fbd-4ca7-a7ca-2f73cd1dc9f5","html_url":"https://github.com/forcedotcom/datacloud-jdbc","commit_stats":null,"previous_names":["forcedotcom/datacloud-jdbc"],"tags_count":43,"template":false,"template_full_name":"salesforce/oss-template","purl":"pkg:github/forcedotcom/datacloud-jdbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forcedotcom%2Fdatacloud-jdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forcedotcom%2Fdatacloud-jdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forcedotcom%2Fdatacloud-jdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forcedotcom%2Fdatacloud-jdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forcedotcom","download_url":"https://codeload.github.com/forcedotcom/datacloud-jdbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forcedotcom%2Fdatacloud-jdbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29128621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T17:12:17.649Z","status":"ssl_error","status_checked_at":"2026-02-05T17:11:23.670Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-19T05:11:02.915Z","updated_at":"2026-02-05T18:02:45.936Z","avatar_url":"https://github.com/forcedotcom.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Salesforce Data 360 JDBC Driver\n\n[![codecov](https://codecov.io/github/forcedotcom/datacloud-jdbc/graph/badge.svg?token=FNEAWV3I42)](https://codecov.io/github/forcedotcom/datacloud-jdbc)\n\nWith the Salesforce Data 360 JDBC driver you can efficiently query millions of rows of data with low latency, and perform bulk data extractions.\nThis driver is read-only, forward-only, and requires Java 8 or greater. It uses the new [Data 360 Query API SQL syntax](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/data-cloud-sql-context.html).\n\nDownload the jar here: [![Maven Central Version](https://img.shields.io/maven-central/v/com.salesforce.datacloud/jdbc)](https://repo1.maven.org/maven2/com/salesforce/datacloud/jdbc/)\n\n## Example usage\n\nWe have a suite of tests that demonstrate preferred usage patterns when using APIs that are outside of the JDBC specification.\nPlease check out the [examples here](jdbc-core/src/test/java/com/salesforce/datacloud/jdbc/examples).\n\n## Getting started\n\nMost applications should use the shaded variant to avoid dependency conflicts:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.salesforce.datacloud\u003c/groupId\u003e\n    \u003cartifactId\u003ejdbc\u003c/artifactId\u003e\n    \u003cversion\u003e${jdbc.version}\u003c/version\u003e\n    \u003cclassifier\u003eshaded\u003c/classifier\u003e\n\u003c/dependency\u003e\n```\n\nIf you need to manage gRPC and protos dependencies directly, use the standard JAR:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.salesforce.datacloud\u003c/groupId\u003e\n    \u003cartifactId\u003ejdbc\u003c/artifactId\u003e\n    \u003cversion\u003e${jdbc.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nNote: The default JAR includes generated protos compiled against specific gRPC versions. Applications using different gRPC versions may experience compatibility issues. Please use `jdbc-core` and your own proto generation.\n\nThe class name for this driver is:\n\n```\ncom.salesforce.datacloud.jdbc.DataCloudJDBCDriver\n```\n\n## Usage\n\n\u003e [!INFO]\n\u003e Our API is versioned based on semantic versioning rules around our supported API.\n\u003e This supported API includes:\n\u003e 1. Any construct available through the JDBC specification we have implemented\n\u003e 2. The DataCloudQueryStatus class\n\u003e 3. The public methods in DataCloudConnection, DataCloudStatement, DataCloudResultSet, and DataCloudPreparedStatement -- note that these will be refactored to be interfaces that will make the API more obvious in the near future\n\u003e\n\u003e Usage of any other public classes or methods not listed above should be considered relatively unsafe, though we will strive to not make changes and will use semantic versioning from 1.0.0 and on.\n\n### Connection string\n\nUse `jdbc:salesforce-datacloud://login.salesforce.com`\n\n### JDBC Driver class\n\nUse `com.salesforce.datacloud.jdbc.DataCloudJDBCDriver` as the driver class name for the JDBC application.\n\n### Authentication\n\nWe support three of the [OAuth authorization flows][oauth authorization flows] provided by Salesforce.\nAll of these flows require a connected app be configured for the driver to authenticate as, see the documentation here: [connected app overview][connected app overview].\nSet the following properties appropriately to establish a connection with your chosen OAuth authorization flow:\n\n| Parameter    | Description                                                                                                          |\n|--------------|----------------------------------------------------------------------------------------------------------------------|\n| user         | The login name of the user.                                                                                          |\n| password     | The password of the user.                                                                                            |\n| clientId     | The consumer key of the connected app.                                                                               |\n| clientSecret | The consumer secret of the connected app.                                                                            |\n| privateKey   | The private key of the connected app.                                                                                |\n| refreshToken | Token obtained from the web server, user-agent, or hybrid app token flow.                                            |\n\n\n#### username and password authentication:\n\nThe documentation for username and password authentication can be found [here][username flow].\n\nTo configure username and password, set properties like so:\n\n```java\nProperties properties = new Properties();\nproperties.put(\"user\", \"${userName}\");\nproperties.put(\"password\", \"${password}\");\nproperties.put(\"clientId\", \"${clientId}\");\nproperties.put(\"clientSecret\", \"${clientSecret}\");\n```\n\n#### jwt authentication:\n\nThe documentation for jwt authentication can be found [here][jwt flow].\n\nInstructions to generate a private key can be found [here](#generating-a-private-key-for-jwt-authentication)\n\n```java\nProperties properties = new Properties();\nproperties.put(\"user\", \"${userName}\");\nproperties.put(\"privateKey\", \"${privateKey}\");\nproperties.put(\"clientId\", \"${clientId}\");\n```\n\n#### refresh token authentication:\n\nThe documentation for refresh token authentication can be found [here][refresh token flow].\n\n```java\nProperties properties = new Properties();\nproperties.put(\"refreshToken\", \"${refreshToken}\");\nproperties.put(\"clientId\", \"${clientId}\");\nproperties.put(\"clientSecret\", \"${clientSecret}\");\n```\n\n### Connection settings\n\nSee this page on available [connection settings][connection settings].\nThese settings can be configured in properties by using the prefix `querySetting.`\n\nFor example, to control locale set the following property:\n\n```java\nproperties.put(\"querySetting.lc_time\", \"en_US\");\n```\n\n---\n\n### Generating a private key for jwt authentication\n\nTo authenticate using key-pair authentication you'll need to generate a certificate and register it with your connected app.\n\n```shell\n# create a key pair:\nopenssl genrsa -out keypair.key 2048\n# create a digital certificate, follow the prompts:\nopenssl req -new -x509 -nodes -sha256 -days 365 -key keypair.key -out certificate.crt\n# create a private key from the key pair:\nopenssl pkcs8 -topk8 -nocrypt -in keypair.key -out private.key\n```\n\n### JDBC Details\nThis section describes details around potential pitfalls / ambiguities related to JDBC\n- The standard offers two types for fixed point decimals (`NUMERIC` and `DECIMAL`), this driver uses `DECIMAL` to represent such values\n- The JDBC standard describes that `getObject` for a `SHORT` should return an `Integer`. Due to a current limitation we for now return a `Short` object. This will likely be fixed in a future version of the JDBC driver.\n- The query timeout enforcement is done on the server side for both normal as well as async execution. To provide a safety net with regards to network problems the driver locally also does a delayed enforcement for normal query executions. The default delay is `5` seconds - which typically shouldn't be relevant as in normal circumstances the server will enforce the timeout. The local enforcement delay can be configured through the `queryTimeoutLocalEnforcementDelay` property\n\n### Optional configuration\n\n- `dataspace`: The data space to query, defaults to \"default\"\n\n### Usage sample code\n\n```java\npublic static void executeQuery() throws ClassNotFoundException, SQLException {\n    Class.forName(\"com.salesforce.datacloud.jdbc.DataCloudJDBCDriver\");\n\n    Properties properties = new Properties();\n    properties.put(\"user\", \"${userName}\");\n    properties.put(\"password\", \"${password}\");\n    properties.put(\"clientId\", \"${clientId}\");\n    properties.put(\"clientSecret\", \"${clientSecret}\");\n\n    try (var connection = DriverManager.getConnection(\"jdbc:salesforce-datacloud://login.salesforce.com\", properties);\n         var statement = connection.createStatement()) {\n        var resultSet = statement.executeQuery(\"${query}\");\n\n        while (resultSet.next()) {\n            // Iterate over the result set\n        }\n    }\n}\n```\n\n[oauth authorization flows]: https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_flows.htm\u0026type=5\n[username flow]: https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_username_password_flow.htm\u0026type=5\n[jwt flow]: https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_jwt_flow.htm\u0026type=5\n[refresh token flow]: https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_refresh_token_flow.htm\u0026type=5\n[connection settings]: https://tableau.github.io/hyper-db/docs/hyper-api/connection#connection-settings\n[connected app overview]: https://help.salesforce.com/s/articleView?id=sf.connected_app_overview.htm\u0026type=5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforcedotcom%2Fdatacloud-jdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforcedotcom%2Fdatacloud-jdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforcedotcom%2Fdatacloud-jdbc/lists"}