Prerequisites
- Installation of the SAP HANA client and a working JDBC connection to your SAP HANA instance. This can be confirmed using various Workbench tools such as SQLWorkbenchJ and DBeaver
- Knowledge of your SAP HANA instance’s default SQL listener port. The default port is 39013.
- A Working Installation of OpenLink Software’s Lite Edition ODBC-JDBC Bridge Driver with an Evaluation or Commercial License (Instructions).
Instructions
- Add the SAP HANA ngdbc.jar document included in the SAP HANA client package to /Library/Java/Extentsions .
- Open iODBC Administrator, and click on add . Select OpenLink JDBC Lite Driver or OpenLink JDBC Lite Driver (Unicode) , then click Finish .
- Select a name for your Data Source Name (DSN), add a description if needed, and click Continue.
- Enter the JDBC Driver Classname , and JDBC String for your SAP HANA instance.
The Classname is:
com.sap.db.jdbc.Driver
The URL scheme is:
jdbc:sap://<server host>:<port>[/?<options>]
- Check the Connect now to verify that all settings are correct checkbox, enter your SAP HANA username/password, and Click on the Test tab.
If a successful connection is made, a confirmation message will appear. Click OK
- Click Test Data source. A successful test connection will result in another confirmation message. Click OK , followed by Finish .
Running a Test Query
- Open the iODBC Demo ANSI or iODBC Demo Unicode applications that are automatically installed with OpenLink’s Data Access Drivers for macOS for testing ODBC connections; and navigate to Environment → Open Connection
- Select your newly created DSN, and click OK
- Enter your SAP HANA user credentials and click connect
- A successful connection will return to the empty user interface. Navigate to SQL → Execute SQL… and enter your SQL query into the resulting text box. Once completed, click OK
- On successful execution, the previously empty UI will be populated with the query results returned from our SAP HANA database.
Following a successful test query, you can now use the ODBC driver with other ODBC-compliant applications on macOS such as: Excel, FilemakerPro, and others.