Ready to get started?

Download a free trial of the SAP Netweaver Gateway Driver to get started:

 Download Now

Learn more:

SAP Netweaver Gateway Icon SAP Netweaver Gateway JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with SAP Netweaver Gateway.

Connect to SAP Netweaver Gateway Data in RazorSQL



Connect to SAP Netweaver Gateway from wizards and query SAP Netweaver Gateway data from the GUI in the RazorSQL database management tool.

The CData JDBC Driver for SAP Netweaver Gateway enables standards-based access from third-party tools, from wizards in IDEs to data management and analysis tools. This article shows how to connect to SAP Netweaver Gateway using wizards in RazorSQL.

Create a JDBC Data Source for SAP Netweaver Gateway Data

  1. Open the RazorSQL application and, in the Connections menu, select Add Connection Profile -> Other -> JDBC.
  2. In the Connection Wizard that appears, set the following properties:
    • Driver Location: Set this property to the path to the lib subfolder in the installation directory.
    • Driver Class: Set the driver class to cdata.jdbc.sapgateway.SAPGatewayDriver.
    • Username: Enter the username. (This property can also be set in the JDBC URL.)
    • Password: Enter the password. (This property can also be set in the JDBC URL.)
    • JDBC URL: Enter connection parameters. The JDBC URL begins with jdbc:sapgateway: and is followed by a semicolon-separated list of connection properties.

      SAP Gateway allows both basic and OAuth 2.0 authentication. You can use basic authentication to connect to your own account, or you can use OAuth to enable other users to retrieve data from your service with their accounts. In addition to authenticating, set the following connection properties to access SAP Gateway tables.

      • Url: Set this to the URL of your environment, or to the full URL of the service. For example, the full URL might appear as: https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/. In this example, the environment URL would just be: https://sapes5.sapdevcenter.com.
      • Namespace: Set the appropriate Service Namespace. In the example above, IWBEP is the namespace. It is optional if the full URL to the service is specified.
      • Service: Set this to the service you want to retrieve data from. In the example above, the service is GWSAMPLE_BASIC. It is not required if the full URL is specified.

      Authenticate via Basic Authentication

      In basic authentication, you use your login credentials to connect. Set the following properties:

      • User: This is the username you use to log in to SAP Gateway.
      • Password: This is the password you use to log in to SAP Gateway.

      Authenticate via OAuth Authentication

      You can connect to SAP Gateway using the embedded OAuth connectivity (without setting any additional authentication connection properties). When you connect, the OAuth endpoint opens in your browser. Log in and grant permissions to complete the OAuth process. See the OAuth section in the online Help documentation for more information on other OAuth authentication flows.

      Built-in Connection String Designer

      For assistance in constructing the JDBC URL, use the connection string designer built into the SAP Netweaver Gateway JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

      java -jar cdata.jdbc.sapgateway.jar

      Fill in the connection properties and copy the connection string to the clipboard.

      A typical JDBC URL is the following:

      jdbc:sapgateway:User=user;Password=password;URL=https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/;InitiateOAuth=GETANDREFRESH

Query SAP Netweaver Gateway Data and Select Tables

After establishing a connection, the wizard will close and the connection will be available in the connections panel. You can then query the tables.