SAP Knowledge Base Article - Public

3685618 - Error: "Failed to retrieve data from the database." when refreshing a report connecting via JDBC to Databricks in Crystal Reports

Symptom

  • Some report based on Databricks fails to refresh in Crystal Reports. 
  • When refreshing a report connecting to Databricks via JDBC that is expected to return a large result set, it fails with the error:

         "Failed to retrieve data from the database.
          Details: [Database Vendor Code: 12345 ]"    

Environment

  • SAP Crystal Reports 2020
  • SAP Crystal Reports 2025
      
  • Databricks

Reproducing the Issue

  1. In Crystal Reports, create a report to Databricks using a JDBC connection.
  2. Refresh the report.
  3. It fails with the error: "Failed to retrieve data from the database. Details: [Database Vendor Code: 12345]"

Cause

  • When using the Databrick JDBC driver, the result set is downloaded in a temporary file.
  • When Databricks returns a large data set, it generates a large file to download, and the JDBC connection fails to download the file and generates the error:

    "The file <File Name> has not been downloaded successfully and the driver will not retry due to exceeding of the max retry limit 10, you can increase the max retry limit by setting MaxConsecutiveResultFileDownloadRetries."

Resolution

  • To change how the Databricks JDBC driver works, and return the result set in batch, instead of downloading one large result set file,
    add the Datababricks JDBC driver parameter: EnableQueryResultDownload=0 to the report JDBC Connection URL in the report:
       
    1. In Crystal Reports, open the report that connects via JDBC to Databricks.

    2. Under the menu "Database", select: "Set Datasource Location"

    3. In Set Datasource Location, under "Current Data Source", expend the Properties of the JDBC connection to Databricks.

    4. Double click the property: Connection URL   ( It will now be in edit mode)

    5. At the end of the JDBC Connection string, add a semi-column, and the parameter: EnableQueryResultDownload=0

      The connection URL will look like:   jdbc:databricks://<SERVER>:<PORT NUMBER>;EnableQueryResultDownload=0
        
    6. Hit enter, and when prompted by the Datababricks user name and password, enter the credientials.

    7. Back to the "Set Datasource Location" window, at the bottom right corner, click "Close"

    8. Save the report.

Keywords

CR, JDBC, Connection String, Databrick, large dataset , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2020 ; SAP Crystal Reports 2025