• Glossary
  • Support
  • Downloads
  • DataStax Home
Get Live Help
Expand All
Collapse All

DataStax Astra DB Serverless Documentation

    • Overview
      • Release notes
      • Astra DB FAQs
      • Astra DB glossary
      • Get support
    • Getting Started
      • Grant a user access
      • Load and retrieve data
        • Use DSBulk to load data
        • Use Data Loader in Astra Portal
      • Connect a driver
      • Build sample apps
      • Use integrations
        • Connect with DataGrip
        • Connect with DBSchema
        • Connect with JanusGraph
        • Connect with Strapi
    • Planning
      • Plan options
      • Database regions
    • Securing
      • Security highlights
      • Security guidelines
      • Default user permissions
      • Change your password
      • Reset your password
      • Authentication and Authorization
      • Astra DB Plugin for HashiCorp Vault
    • Connecting
      • Connecting private endpoints
        • AWS Private Link
        • Azure Private Link
        • GCP Private Endpoints
        • Connecting custom DNS
      • Connecting Change Data Capture (CDC)
      • Connecting CQL console
      • Connect the Spark Cassandra Connector to Astra
      • Drivers for Astra DB
        • Connecting C++ driver
        • Connecting C# driver
        • Connecting Java driver
        • Connecting Node.js driver
        • Connecting Python driver
        • Drivers retry policies
      • Connecting Legacy drivers
      • Get Secure Connect Bundle
    • Migrating
      • FAQs
      • Preliminary steps
        • Feasibility checks
        • Deployment and infrastructure considerations
        • Create target environment for migration
        • Understand rollback options
      • Phase 1: Deploy ZDM Proxy and connect client applications
        • Set up the ZDM Automation with ZDM Utility
        • Deploy the ZDM Proxy and monitoring
          • Configure Transport Layer Security
        • Connect client applications to ZDM Proxy
        • Manage your ZDM Proxy instances
      • Phase 2: Migrate and validate data
      • Phase 3: Enable asynchronous dual reads
      • Phase 4: Change read routing to Target
      • Phase 5: Connect client applications directly to Target
      • Troubleshooting
        • Troubleshooting tips
        • Troubleshooting scenarios
      • Additional resources
        • Glossary
        • Contribution guidelines
        • Release Notes
    • Managing
      • Managing your organization
        • User permissions
        • Pricing and billing
        • Audit Logs
        • Bring Your Own Key
          • BYOK AWS Astra DB console
          • BYOK GCP Astra DB console
          • BYOK AWS DevOps API
          • BYOK GCP DevOps API
        • Configuring SSO
          • Configure SSO for Microsoft Azure AD
          • Configure SSO for Okta
          • Configure SSO for OneLogin
      • Managing your database
        • Create your database
        • View your databases
        • Database statuses
        • Use DSBulk to load data
        • Use Data Loader in Astra Portal
        • Monitor your databases
        • Export metrics to third party
          • Export metrics via Astra Portal
          • Export metrics via DevOps API
        • Manage access lists
        • Manage multiple keyspaces
        • Using multiple regions
        • Terminate your database
      • Managing with DevOps API
        • Managing database lifecycle
        • Managing roles
        • Managing users
        • Managing tokens
        • Managing BYOK AWS
        • Managing BYOK GCP
        • Managing access list
        • Managing multiple regions
        • Get private endpoints
        • AWS PrivateLink
        • Azure PrivateLink
        • GCP Private Service
    • Astra CLI
    • DataStax Astra Block
      • FAQs
      • About NFTs
      • DataStax Astra Block for Ethereum quickstart
    • Developing with Stargate APIs
      • Develop with REST
      • Develop with Document
      • Develop with GraphQL
        • Develop with GraphQL (CQL-first)
        • Develop with GraphQL (Schema-first)
      • Develop with gRPC
        • gRPC Rust client
        • gRPC Go client
        • gRPC Node.js client
        • gRPC Java client
      • Develop with CQL
      • Tooling Resources
      • Node.js Document API client
      • Node.js REST API client
    • Stargate QuickStarts
      • Document API QuickStart
      • REST API QuickStart
      • GraphQL API CQL-first QuickStart
    • API References
      • DevOps REST API v2
      • Stargate Document API v2
      • Stargate REST API v2
  • DataStax Astra DB Serverless Documentation
  • Migrate C++ driver

Migrate C++ driver

Complete the following procedure to migrate your existing DataStax C++ driver to a version that is capable of connecting to Astra databases created using DataStax Astra DB.

Prerequisites

  • Create a database using Astra DB.

  • Download the secure connect bundle to obtain connection credentials for your Astra DB database.

  • Get your Client ID and Client Secret by creating your application token for your username and password.

    Alternatively, have a teammate provide access to their Astra database.

  • Download the DataStax C++ driver and dependency packages for your platform using the links in the following table:

DataStax C++ driver download links

Platform Download links

CentOS 6

Driver | Dependencies

CentOS 7

Driver | Dependencies

CentOS 8

Driver | Dependencies

Ubuntu 14.04

Driver | Dependencies

Ubuntu 16.04

Driver | Dependencies

Ubuntu 18.04

Driver | Dependencies

Windows

Driver | Dependencies

Other platforms should build the driver from the source code packages.

  • Using the packages you downloaded, follow the installation instructions for your platform to install the DataStax C++ driver.

Procedure

  1. In your existing DataStax C++ driver code, modify the connection code to use the Astra DB API.

    Both the DataStax C driver for Apache Cassandra and the {company} Enterprise (DSE) C driver use the same code to connect and query your Astra database. When using the DSE C++ driver, use the header #include <dse.h>.

    The secure_connect_bundle must include the absolute path to your Astra database credentials (secure-connect-**database_name**.zip).

    cass_cluster_set_credentials(cluster, "clientId", "clientSecret");
    
      CassFuture* connect_future = cass_session_connect(session, cluster);
      if (cass_future_error_code(connect_future) == CASS_OK) {
        * Use the session to run queries _
        }
      else {
        _ Handle error *
      }
  2. Build and link your application against the DataStax C++ driver.

    • Linux or macOS

      For static linking, use cassandra_static.a or dse_static.a.

      • DataStax C++ driver for Apache Cassandra

      • DSE C++ driver

      cc connect-database.c -I/path/to/cassandra.h -L/path/to/cassandra.so -lcassandra
      cc connect-database.c -I/path/to/dse.h -L/path/to/dse.so -ldse
    • Windows Include these libraries in your Microsoft Visual Studio project by adding them to the project’s properties under ]Configuration Properties/Linker/Input/Additional Dependencies.

      For static linking, use cassandra_static.lib or dse_static.libpass:c[.

DataStax C++ driver for Apache Cassandra Link your application against cassandra.lib. Your application will also require `cassandra.dll to be in your runtime path.

DSE C++ driver Link your application against dse.lib. Your application will also require dse.dll to be in your runtime path.

General Inquiries: +1 (650) 389-6000 info@datastax.com

© DataStax | Privacy policy | Terms of use

DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

Kubernetes is the registered trademark of the Linux Foundation.

landing_page landingpage