JDBC Driver for SAP HANA XSA

Build 22.0.8462

Establishing a Connection

Creating a JDBC Data Source

You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for SAP HANA XSA consists of three basic steps:

  • Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
  • Provide the driver class. For example:
    cdata.jdbc.saphanaxsa.SAPHanaXSADriver
  • Provide the JDBC URL. For example:
    jdbc:saphanaxsa:User=MyUser;Password=MyPassword;URL=https://hxehost:51027/euro.xsodata;
    
    or
    
    jdbc:cdata:saphanaxsa:User=MyUser;Password=MyPassword;URL=https://hxehost:51027/euro.xsodata;

    The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:saphanaxsa:" or "jdbc:cdata:saphanaxsa:" and can include any of the connection properties in name-value pairs separated with semicolons.

SAP HANA XSA uses the OAuth authentication standard. Before connecting, it is necessary to establish an SAP HANA XSA OData Service. See Creating a Custom OAuth App for a guide.

To connect to SAP HANA XSA using the OAuthPassword Grant type set the following:

  • OAuthClientId: Set this to the Client Id specified in the UAA service JSON file.
  • OAuthClientSecret: Set this to the Client Secret specified in the UAA service JSON file.
  • Url: Set this to the OData service endpoint.
  • XSUAAURL: Set this to the UAA service url.
  • User: Set your accounts username.
  • Password: Set your accounts password

Once you've configured the OData Service, you can establish a connection using Custom Credentials.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462