diff --git a/tutorials/hana-clients-dot-net-core/hana-clients-dot-net-core.md b/tutorials/hana-clients-dot-net-core/hana-clients-dot-net-core.md index 30ac4bdcb..6bd3fab22 100644 --- a/tutorials/hana-clients-dot-net-core/hana-clients-dot-net-core.md +++ b/tutorials/hana-clients-dot-net-core/hana-clients-dot-net-core.md @@ -37,13 +37,22 @@ dotnet --version If the `dotnet` command is not recognized, it means that the .NET SDK has not been installed. If the SDK is installed, the command returns the currently installed version, such as 8.0.203. +[OPTION BEGIN [Windows and Mac]] + If the .NET SDK is not installed, download it from [Download .NET](https://dotnet.microsoft.com/download) and run the installer on Microsoft Windows or Mac. ![.NET Core SDK install](dotnet-install.png) +[OPTION END] + +[OPTION BEGIN [Linux]] + On Linux, follow the instructions for the appropriate Linux version such as [Install the .NET SDK or the .NET Runtime on openSUSE](https://docs.microsoft.com/en-us/dotnet/core/install/linux-opensuse). -In order for the shell to recognize that the .NET SDK is installed and for any `dotnet` commands in future steps to be recognized, a new shell window needs to be opened. +[OPTION END] + +> [!TIP] +> In order for the shell to recognize that the .NET SDK is installed and for any `dotnet` commands in future steps to be recognized, a new shell window needs to be opened. > [!NOTE] > For further details on supported versions, see SAP Note 3165810 - SAP HANA Client Supported Platforms. @@ -116,7 +125,7 @@ In order for the shell to recognize that the .NET SDK is installed and for any ` { try { - using (var conn = new HanaConnection("Server=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx.hana.prod-xxxx.hanacloud.ondemand.com:443;UID=User1;PWD=Password1;encrypt=true;sslValidateCertificate=false")) + using (var conn = new HanaConnection("Server=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx.hana.prod-xxxx.hanacloud.ondemand.com:443;UID=User1;PWD=Password1;encrypt=true;sslValidateCertificate=false;sessionVariable:APPLICATION=dotNETQuery")) // encrypt and sslValidateCertificate should be true for HANA Cloud connections // As of SAP HANA Client 2.6, connections on port 443 enable encryption by default @@ -167,6 +176,9 @@ In order for the shell to recognize that the .NET SDK is installed and for any ` Save and close the `Program.cs` file after replacing the code and updating the host and port. + > [!NOTE] + > The `sessionVariable:APPLICATION` parameter sets a custom application name for the connection. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + The above app makes use of some of the SAP HANA client .NET driver methods, such as [HanaConnection](https://help.sap.com/docs/SAP_HANA_CLIENT/f1b440ded6144a54ada97ff95dac7adf/d19390d16d6110149af29776dce510bc.html). Connection details for this class can be found at [Microsoft ADO.NET Connection Properties](https://help.sap.com/docs/SAP_HANA_CLIENT/f1b440ded6144a54ada97ff95dac7adf/469e137b6d611014ac27bffe40be2f18.html). Further .NET API details can be found in the [.NET API browser](https://docs.microsoft.com/en-us/dotnet/api/?view=net-6.0). 6. Run the app: diff --git a/tutorials/hana-clients-entity-framework/hana-clients-entity-framework.md b/tutorials/hana-clients-entity-framework/hana-clients-entity-framework.md index b3517776a..1d8e2da9b 100644 --- a/tutorials/hana-clients-entity-framework/hana-clients-entity-framework.md +++ b/tutorials/hana-clients-entity-framework/hana-clients-entity-framework.md @@ -145,7 +145,7 @@ dotnet ef -h } protected override void OnConfiguring(DbContextOptionsBuilder options) { - options.UseHana("Server=xxxxxxxx-.hanacloud.ondemand.com:443;UserName=User2;Password=Password2;Current Schema=USER2"); + options.UseHana("Server=xxxxxxxx-.hanacloud.ondemand.com:443;UserName=User2;Password=Password2;Current Schema=USER2;sessionVariable:APPLICATION=EFCoreQuery"); } } @@ -159,6 +159,9 @@ dotnet ef -h Be sure to update the host URL and optionally the user name and password. + > [!NOTE] + > The `sessionVariable:APPLICATION` parameter sets a custom application name for the connection. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + > [!WARNING] > EnsureDeleted and EnsureCreated will delete and recreate the objects in the schema USER2. As documented at [RelationalDatabaseCreator.EnsureDeleted Method](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.storage.relationaldatabasecreator.ensuredeleted), it will delete all objects in the schema USER2. diff --git a/tutorials/hana-clients-golang/hana-clients-golang.md b/tutorials/hana-clients-golang/hana-clients-golang.md index 27cc7a051..dbad0c749 100644 --- a/tutorials/hana-clients-golang/hana-clients-golang.md +++ b/tutorials/hana-clients-golang/hana-clients-golang.md @@ -42,9 +42,17 @@ If Go is installed, then it will return the currently installed version, such as > [!NOTE] > For further details on supported versions, see SAP Note [3165810 - SAP HANA Client Supported Platforms](https://launchpad.support.sap.com/#/notes/3165810). -If it is not installed, download it from [Download Go](https://golang.org/dl/), run the installer, follow the provided instructions, and ensure that Go is in your path. +[OPTION BEGIN [Windows and Mac]] -On Linux, follow the instructions for the appropriate Linux version such as the [Installing Go for openSUSE](https://en.opensuse.org/SDB:Go). +If Go is not installed, download it from [Download Go](https://golang.org/dl/), run the installer, follow the provided instructions, and ensure that Go is in your path. + +[OPTION END] + +[OPTION BEGIN [Linux]] + +If Go is not installed, follow the instructions for the appropriate Linux version such as the [Installing Go for openSUSE](https://en.opensuse.org/SDB:Go). + +[OPTION END] > [!TIP] > In order for the shell to recognize that Go has been installed and for any go commands in future steps to be recognized, a new shell window needs to be opened. @@ -61,13 +69,15 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, ![gcc 64-bit](gccLinux.png) - For Windows (if it is not installed), it can be downloaded from [Download MinGW](https://www.mingw-w64.org/downloads/). Under **WinLibs.com**, you can install from [winlibs.com](https://winlibs.com/), by scrolling to the **Download** section and downloading the latest release version (UCRT runtime) of the ZIP archive for Win64 to install for the x86_64 architecture, and then extracting the folder. + [OPTION BEGIN [Windows]] + + If `gcc` is not installed, it can be downloaded from [Download MinGW](https://www.mingw-w64.org/downloads/). Under **WinLibs.com**, you can install from [winlibs.com](https://winlibs.com/), by scrolling to the **Download** section and downloading the latest release version (UCRT runtime) of the ZIP archive for Win64 to install for the x86_64 architecture, and then extracting the folder. ![Download minGW from WinLibs](winLibsMinGW.png) If command prompt isn't showing you the installed version after running the version check command, manually add the bin folder to your path by setting it in your environment variables. - On Windows, search **Edit the System Environment Variables** and click on **Environment Variables...**. + Search **Edit the System Environment Variables** in the Microsoft Windows Start menu and click on **Environment Variables...** ![Edit environment variables](editEnvironmentVariables.png) @@ -75,7 +85,23 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, ![Add bin to path](add-bin-to-path.png) - On Linux, install the System GNU C compiler for your version of Linux. Note that if you are using openSUSE, minGW is included in the installation for Go through YaST. + [OPTION END] + + [OPTION BEGIN [Linux]] + + If `gcc` is not installed, install the system GNU C compiler for your version of Linux. The GNU C compiler includes the `gcc` command required by `cgo`. Note that if you are using openSUSE, MinGW is included in the installation for Go through YaST. + + [OPTION END] + + [OPTION BEGIN [Mac]] + + If `gcc` is not installed, install the Xcode Command Line Tools if they are not already installed. These tools include the compiler and related development tools required by `cgo`. + + ```Shell + xcode-select --install + ``` + + [OPTION END] 2. Examine the Go environment by running the below command: @@ -87,9 +113,11 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, GOPATH is set to a location such as `C:\Users\user\go` or `$HOME/go` and defines the root of your workspace which stores your codebase. -3. Set the `CGO_LDFLAGS` environment variable to point to the location of the `libdbcapiHDB` library as shown below and set the `LD_LIBRARY_PATH` if needed. +3. Set the `CGO_LDFLAGS` environment variable to point to the location of the `libdbcapiHDB` library as shown below and set the appropriate library path variable if needed. + + [OPTION BEGIN [Windows]] - On Windows, add a **NEW** variable. Set the variable name to **`CGO_LDFLAGS`** and the variable value to the location of `dbcapi` library: `C:\SAP\hdbclient\libdbcapiHDB.dll` + Add a **NEW** variable. Set the variable name to **`CGO_LDFLAGS`** and the variable value to the location of `dbcapi` library: `C:\SAP\hdbclient\libdbcapiHDB.dll` ![Set environment variables](setEnvVar.png) @@ -97,14 +125,12 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, ![hdbclient path environment variable](hdbclient-path.png) - [OPTION BEGIN [Mac and Linux]] - - On Linux and Mac, add the corresponding following lines to the `.bash_profile`. - [OPTION END] [OPTION BEGIN [Linux]] + Add the following lines to the appropriate shell profile for your environment. + ```Shell export CGO_LDFLAGS=$HOME/sap/hdbclient/libdbcapiHDB.so export LD_LIBRARY_PATH=$HOME/sap/hdbclient @@ -114,6 +140,8 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, [OPTION BEGIN [Mac]] + Add the following lines to the appropriate shell profile for your environment. + ```Shell export CGO_LDFLAGS="$HOME/sap/hdbclient/libdbcapiHDB.dylib" export DYLD_LIBRARY_PATH="$HOME/sap/hdbclient" @@ -187,7 +215,7 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, func main() { //Option 1, retrieve the connection parameters from the hdbuserstore //host, port, user name and password come from the hdbuserstore key USER1UserKey - connectString := "hdb://?key=USER1UserKey&encrypt=true&sslValidateCertificate=false" + connectString := "hdb://?key=USER1UserKey&encrypt=true&sslValidateCertificate=false&sessionVariable:APPLICATION=goQuery.go" //Option 2, specify the connection parameters //connectString := "hdb://User1:Password1@999deec0-ccb7-4a5e-b317-d419e19be648.hana.prod-us10.hanacloud.ondemand.com:443?encrypt=true&sslValidateCertificate=false" @@ -229,6 +257,9 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, Once the `goQuery.go` file has been updated, save and close the file. + > [!NOTE] + > The `sessionVariable:APPLICATION` parameter sets a custom application name for the connection. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + 3. Create another go module and modify its contents: [OPTION BEGIN [Windows]] @@ -268,7 +299,7 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces, [OPTION BEGIN [Mac and Linux]] ```Code - replace SAP/go-hdb/driver v0.1.0 => /home/name/sap/hdbclient/golang/src/SAP/go-hdb/driver + replace SAP/go-hdb/driver v0.1.0 => $HOME/sap/hdbclient/golang/src/SAP/go-hdb/driver require SAP/go-hdb/driver v0.1.0 ``` diff --git a/tutorials/hana-clients-hdbsql/hana-clients-hdbsql.md b/tutorials/hana-clients-hdbsql/hana-clients-hdbsql.md index 937b52ff6..85fc11030 100644 --- a/tutorials/hana-clients-hdbsql/hana-clients-hdbsql.md +++ b/tutorials/hana-clients-hdbsql/hana-clients-hdbsql.md @@ -141,7 +141,7 @@ This step demonstrates how to connect to a SAP HANA instance using [HDBSQL](http - If you are on a Linux or Mac machine and the hdbsql connection fails with the error message below, it indicates that the OpenSSL library could not locate a trust store in the default location. - _Cannot create SSL context: SSL trust store cannot be found: `/Users/user1/.ssl/trust.pem`_ + _Cannot create SSL context: SSL trust store cannot be found: `$HOME/.ssl/trust.pem` A public root certificate to validate the server's certificate is needed. More information about the required DigiCert root certificate can be found at [Secure Communication Between SAP HANA Cloud and JDBC/ODBC Clients](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-security-guide/secure-communication-between-sap-hana-and-sap-hana-clients) and [3397584 - HANA Cloud Connections will switch from "DigiCert Global Root CA" to "DigiCert TLS RSA4096 Root G5"](https://me.sap.com/notes/3397584). @@ -165,10 +165,10 @@ This step demonstrates how to connect to a SAP HANA instance using [HDBSQL](http This step creates two users and a schema. `USER1` will be the owner of the tables that will be created in a subsequent step and will be used to connect to the database. -On Linux or a Mac, turn off page by page scroll output. Also, consult the `-j` `hdbsql` option. This enables multiple commands to be pasted at one time and does not require each result to be exited by pressing q. - [OPTION BEGIN [Mac and Linux]] +Turn off page by page scroll output. Also, consult the `-j` `hdbsql` option. This enables multiple commands to be pasted at one time and does not require each result to be exited by pressing q. + ```HDBSQL \pa off ``` @@ -244,8 +244,6 @@ Remembering and entering IP addresses, ports, user IDs and passwords can be diff > [!TIP] > Uppercase `-U` is for specifying a key from the user store, lower case `-u` is for user. ---- - [Using Stored Connection Information](https://help.sap.com/docs/SAP_HANA_CLIENT/f1b440ded6144a54ada97ff95dac7adf/708e5fe0e44a4764a1b6b5ea549b88f4.html) contains details on how an application can use a `hdbuserstore` key. ### Create tables and insert data @@ -264,10 +262,10 @@ Remembering and entering IP addresses, ports, user IDs and passwords can be diff [OPTION END] - Substitute `pico` below for your preferred text editor. - [OPTION BEGIN [Mac and Linux]] + Substitute `pico` below for your preferred text editor. + ```Shell mkdir -p $HOME/HANAClientsTutorial/sql cd $HOME/HANAClientsTutorial/sql diff --git a/tutorials/hana-clients-jdbc/hana-clients-jdbc.md b/tutorials/hana-clients-jdbc/hana-clients-jdbc.md index 98d2d3ebf..2e7a9b2fa 100644 --- a/tutorials/hana-clients-jdbc/hana-clients-jdbc.md +++ b/tutorials/hana-clients-jdbc/hana-clients-jdbc.md @@ -32,7 +32,7 @@ primary_tag: software-product>sap-hana-cloud Ensure that you have a Java Development Kit (JDK) installed and ensure that it is accessible from your path. Details on supported versions can be found at SAP Note [3165810 - SAP HANA Client Supported Platforms](https://launchpad.support.sap.com/#/notes/3165810). -An OpenJDK from SAP is available at [SapMachine](https://sap.github.io/SapMachine/#download). If you don't already have a JDK installed, please install it from SapMachine. +An OpenJDK from SAP is available at [SapMachine](https://sap.github.io/SapMachine/#download). If you don't already have a JDK installed, you can install it from SapMachine or use your operating system's package manager. To verify that the JDK is correctly set up, run the following: @@ -173,7 +173,7 @@ See [JDBC Command-Line Connection Options](https://help.sap.com/docs/SAP_HANA_CL connection = DriverManager.getConnection( //Option 1, retrieve the connection parameters from the hdbuserstore //The below URL gets the host, port and credentials from the hdbuserstore. - "jdbc:sap://dummy_host:0/?KEY=USER1UserKey&encrypt=true&validateCertificate=false"); + "jdbc:sap://dummy_host:0/?KEY=USER1UserKey&encrypt=true&validateCertificate=false&sessionVariable:APPLICATION=JavaQuery.java"); //Option2, specify the connection parameters //"jdbc:sap://10.11.123.134:39015/?encrypt=true&validateCertificate=false", "User1", "Password1"); @@ -211,6 +211,9 @@ See [JDBC Command-Line Connection Options](https://help.sap.com/docs/SAP_HANA_CL } ``` + > [!NOTE] + > The `sessionVariable:APPLICATION` parameter sets a custom application name for the connection. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + 3. Compile the `.java` file into a `.class` file using the following command. [OPTION BEGIN [Windows]] diff --git a/tutorials/hana-clients-node/custom-application-name-query.png b/tutorials/hana-clients-node/custom-application-name-query.png new file mode 100644 index 000000000..f90642a43 Binary files /dev/null and b/tutorials/hana-clients-node/custom-application-name-query.png differ diff --git a/tutorials/hana-clients-node/hana-clients-node.md b/tutorials/hana-clients-node/hana-clients-node.md index ab7f57b5d..30dd2256e 100644 --- a/tutorials/hana-clients-node/hana-clients-node.md +++ b/tutorials/hana-clients-node/hana-clients-node.md @@ -233,7 +233,9 @@ npm list @sap/hana-client var connOptions = { //Option 1, retrieve the connection parameters from the hdbuserstore - serverNode: '@USER1UserKey', //host, port, uid, and pwd retrieved from hdbuserstore + serverNode: '@USER1UserKey', //host, port, uid, and pwd retrieved from hdbuserstore + sslValidateCertificate: 'false', //Must be set to false when connecting to an SAP HANA on-premise instance that uses a self-signed certificate. + 'sessionVariable:APPLICATION': 'nodeQuery.js', //Optional custom application name //Option 2, specify the connection parameters //serverNode: 'host:port', @@ -247,8 +249,6 @@ npm list @sap/hana-client //As of SAP HANA client 2.6, connections on port 443 enable encryption by default (HANA Cloud). //encrypt: 'true', //Must be set to true when connecting to HANA as a Service - sslValidateCertificate: 'false', //Must be set to false when connecting to an SAP HANA on-premise instance that uses a self-signed certificate. - //For encrypted connections, the default crypto provider is mscrypto on Windows or openSSL on Linux or macos //To use the SAP crypto provider, uncomment the below line. //sslCryptoProvider: 'commoncrypto', @@ -286,6 +286,9 @@ npm list @sap/hana-client connection.disconnect(); ``` + > [!NOTE] + > The `sessionVariable:APPLICATION` parameter sets a custom application name for the connection. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + 3. Run the app. ```Shell @@ -298,7 +301,24 @@ npm list @sap/hana-client Notice in the documentation that the above methods support being called in a synchronous or asynchronous manner. Two examples showing the drivers methods being used asynchronously are shown in the next two steps. -4. To enable debug logging of the SAP HANA Node.js client, enter the following command and then rerun the app. +4. After running the application, you can verify that the custom application name (nodeQuery.js) was successfully set by querying the `M_CONNECTIONS` system view from any SQL client (i.e. SAP HANA Cloud Central) connected to the same SAP HANA Cloud Instance. + + Execute the following SQL. + ```SQL + SELECT + CLIENT_APPLICATION, + CLIENT_TYPE, + USER_NAME + FROM M_CONNECTIONS + WHERE USER_NAME = CURRENT_USER + ORDER BY START_TIME DESC; + ``` + + A row similar to the one highlighted below should appear, with `CLIENT_APPLICATION` being nodeQuery.js. + + ![Checking Node application name](custom-application-name-query.png) + +5. To enable debug logging of the SAP HANA Node.js client, enter the following command and then rerun the app. [OPTION BEGIN [Windows]] @@ -386,7 +406,7 @@ Connection pooling can improve performance when making multiple, brief connectio var connOptions = { //Option 1, retrieve the connection parameters from the hdbuserstore - serverNode: '@USER1UserKey' //host, port, uid, and pwd retrieved from hdbuserstore + serverNode: '@USER1UserKey', //host, port, uid, and pwd retrieved from hdbuserstore //Option 2, specify the connection parameters //serverNode: 'host:port', diff --git a/tutorials/hana-clients-odbc/advanced-settings.png b/tutorials/hana-clients-odbc/advanced-settings.png new file mode 100644 index 000000000..a6d534fda Binary files /dev/null and b/tutorials/hana-clients-odbc/advanced-settings.png differ diff --git a/tutorials/hana-clients-odbc/config-odbc-application-name.png b/tutorials/hana-clients-odbc/config-odbc-application-name.png new file mode 100644 index 000000000..0f63724a9 Binary files /dev/null and b/tutorials/hana-clients-odbc/config-odbc-application-name.png differ diff --git a/tutorials/hana-clients-odbc/hana-clients-odbc.md b/tutorials/hana-clients-odbc/hana-clients-odbc.md index e6d0e349e..4f43720c8 100644 --- a/tutorials/hana-clients-odbc/hana-clients-odbc.md +++ b/tutorials/hana-clients-odbc/hana-clients-odbc.md @@ -27,7 +27,9 @@ primary_tag: software-product>sap-hana-cloud --- -### Configure a data source using Microsoft Windows ODBC Data Source Administrator +### Configure a data source + +[OPTION BEGIN [Windows]] The ODBC Data Source Administrator lists the installed ODBC drivers and the configured data sources. @@ -80,7 +82,9 @@ The ODBC Data Source Administrator lists the installed ODBC drivers and the conf For additional details see [Connect to SAP HANA via ODBC](https://help.sap.com/docs/SAP_HANA_CLIENT/f1b440ded6144a54ada97ff95dac7adf/66a4169b84b2466892e1af9781049836.html). -### Configure a data source on Linux or Mac with unixODBC +[OPTION END] + +[OPTION BEGIN [Mac and Linux]] The following instructions demonstrate how [unixODBC](http://www.unixodbc.org/) can be used to configure and test a data source on Linux or Mac. @@ -92,14 +96,10 @@ The following instructions demonstrate how [unixODBC](http://www.unixodbc.org/) 2. On a Mac, unixODBC can be installed using [Homebrew](https://brew.sh). - [OPTION BEGIN [Mac]] - ```Shell brew install unixodbc ``` - [OPTION END] - 3. The following commands can be used to confirm that unixODBC is installed, determine the location of the .odbc.ini file (if it exists), and to confirm the location of the SAP HANA client install that contains the ODBC driver. ```Shell @@ -126,13 +126,18 @@ The following instructions demonstrate how [unixODBC](http://www.unixodbc.org/) driver = /home/dan/sap/hdbclient/libodbcHDB.so encrypt = true sslValidateCertificate = true + sessionVariable:APPLICATION = ODBC Application [HANA_OnPremise] servernode = hxehost:39015 driver = /home/dan/sap/hdbclient/libodbcHDB.so databasename = HXE + sessionVariable:APPLICATION = ODBC Application ``` + > [!NOTE] + > The `sessionVariable:APPLICATION` property sets a custom application name for the connection. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + 6. unixODBC provides a basic SQL query tool called `isql` that can be used to validate a data source. ```Shell @@ -147,6 +152,42 @@ The following instructions demonstrate how [unixODBC](http://www.unixodbc.org/) ![isql](isqlQuery.png) +[OPTION END] + +### Set custom application name +> [!NOTE] +> Linux and macOS users can set a custom application name by adding the `sessionVariable:APPLICATION` property to the data source definition in the `.odbc.ini` file as shown in the previous step. +> The following instructions only apply to Microsoft Windows. + +The SAP HANA ODBC driver supports setting a custom application name using the `sessionVariable:APPLICATION` connection property. This value can be viewed in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and may also appear in SAP HANA telemetry data. + +1. Open **ODBC Data Sources (64-bit)** from the Microsoft Windows Start menu. + +2. Select your SAP HANA data source and click **Configure**. + + ![Configure ODBC application name](config-odbc-application-name.png) + +3. Click **Advanced** in the lower-left corner of the configuration dialog. + + ![Open ODBC advanced settings](advanced-settings.png) + + +4. Click **Add** and enter the following values: + + - **Property:** `sessionVariable:APPLICATION` + + - **Value:** `ODBC Application` + - You can replace ODBC Application with your preferred application name. + + ![Add ODBC connection property](odbc-connection-property.png) + +5. Click **OK** to close the Advanced dialog. + +6. Click **OK** on each remaining configuration window to save the changes. + + > [!NOTE] + > The custom application name will not be saved unless you confirm and close all open configuration dialogs by clicking OK. + ### Use a SAP HANA data source from another program An application that supports ODBC can now make use of the created data source. One example on Windows is Microsoft Excel. diff --git a/tutorials/hana-clients-odbc/isqlQuery.png b/tutorials/hana-clients-odbc/isqlQuery.png index 3996e092c..069dc46b8 100644 Binary files a/tutorials/hana-clients-odbc/isqlQuery.png and b/tutorials/hana-clients-odbc/isqlQuery.png differ diff --git a/tutorials/hana-clients-odbc/odbc-connection-property.png b/tutorials/hana-clients-odbc/odbc-connection-property.png new file mode 100644 index 000000000..982f5db43 Binary files /dev/null and b/tutorials/hana-clients-odbc/odbc-connection-property.png differ diff --git a/tutorials/hana-clients-python/hana-clients-python.md b/tutorials/hana-clients-python/hana-clients-python.md index 217e40b82..0bb55a2cc 100644 --- a/tutorials/hana-clients-python/hana-clients-python.md +++ b/tutorials/hana-clients-python/hana-clients-python.md @@ -64,8 +64,12 @@ pip3 --version pip3 install --upgrade pip ``` +[OPTION BEGIN [Mac and Linux]] + > [!TIP] -> On Linux or Mac, if you encounter permission issues, one way to solve the issue is to use `sudo` before the command. +> If you encounter permission issues, one way to solve the issue is to use `sudo` before the command. + +[OPTION END] [OPTION BEGIN [Linux]] @@ -179,6 +183,8 @@ pip show hdbcli #user='User1', #password='Password1', + # Python's ** operator expands the dictionary into keyword arguments + **{"sessionVariable:APPLICATION": "pythonQuery.py"} # optional custom application name #Additional parameters #encrypt=True, # must be set to True when connecting to HANA as a Service #As of SAP HANA Client 2.6, connections on port 443 enable encryption by default (HANA Cloud) @@ -218,7 +224,10 @@ pip show hdbcli conn.close() ``` - Note that the address, port, UID and PWD will be retrieved from the `hdbuserstore`. + Note that the address, port, UID and PWD will be retrieved from the `hdbuserstore`. + + > [!NOTE] + > The `sessionVariable:APPLICATION` parameter sets a custom application name for the connection. This value may appear in the `CLIENT_APPLICATION` column of the `M_CONNECTIONS` system view and in SAP HANA telemetry data, making it easier to identify connections generated by a specific application. 3. Run the app.