Skip to content

Commit 22d5af9

Browse files
committed
Updates to the data lake clients tutorials
1 parent 268bef2 commit 22d5af9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+84
-229
lines changed
Loading

tutorials/hana-clients-golang/hana-clients-golang.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Go is an open-source programming language developed by Google to increase produc
2222
---
2323

2424
### Install Go
25-
2625
The first step is to check if Go is installed, and if so, which version. To do so, enter the following command:
2726

2827
```Shell
@@ -57,6 +56,14 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces,
5756

5857
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.
5958
59+
>On Windows, search **Edit the System Environment Variables** and click on **Environment Variables...**.
60+
>
61+
![Edit Environment Variables](editEnvironmentVariables.png)
62+
63+
Look for the `Path` environment variable and double click to edit. Select **Browse** and manually browse through your File Explorer to find the bin folder.
64+
65+
![Add bin to path](add-bin-to-path.png)
66+
6067
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.
6168
6269
![gcc 64-bit](gccLinux.png)
@@ -71,38 +78,24 @@ The SAP HANA Client interface for Go, like the other SAP HANA client interfaces,
7178
7279
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.
7380
74-
3. Set the required environment variables.
75-
76-
On Windows, search **Edit the System Environment Variables** and click on **Environment Variables...**.
77-
78-
>Optionally, you can also use the **SETX** command in command prompt to set a Windows environment variable. For example, `SETX CGO_LDFLAGS C:\SAP\hdbclient\libdbcapiHDB.dll`. Note that this will set a user variable, not a system variable.
79-
80-
![Edit Environment Variables](editEnvironmentVariables.png)
81-
82-
On Linux, open the `.bash_profile`.
83-
84-
```Shell (Linux or Mac)
85-
pico ~/.bash_profile
86-
```
87-
88-
4. 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.
81+
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.
8982
90-
On Windows, add the **NEW** System Variable. Set the variable name to **`CGO_LDFLAGS`** and the variable value to the location of `dbcapi` library: `C:\SAP\hdbclient\libdbcapiHDB.dll`
83+
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`
9184
9285
![Set Environment Variables](setEnvVar.png)
9386
9487
Ensure that the `hdbclient` folder is set in your **Path** environment variable. You can set this path by clicking on **New** and browsing for your `hdbclient` folder.
9588
9689
![hdbclient path env variable](hdbclient-path.png)
9790
98-
On Linux, add the following lines to the `bash_profile`.
91+
On Linux, add the following lines to the `.bash_profile`.
9992
10093
```Shell (Linux or Mac)
10194
export CGO_LDFLAGS=$HOME/sap/hdbclient/libdbcapiHDB.so
10295
export LD_LIBRARY_PATH=$HOME/sap/hdbclient
10396
```
10497
105-
5. Go to the driver folder and create a go module.
98+
4. Go to the driver folder and create a go module.
10699
107100
```Shell (Windows)
108101
cd C:\SAP\hdbclient\golang\src\SAP\go-hdb\driver
-131 KB
Loading

tutorials/hana-clients-jdbc/hana-clients-jdbc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ primary_tag: software-product>sap-hana-cloud
2828

2929
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).
3030

31-
An OpenJDK from SAP is available at [SapMachine](https://sap.github.io/SapMachine/#download)
31+
An OpenJDK from SAP is available at [SapMachine](https://sap.github.io/SapMachine/#download).
3232

3333
To verify that the JDK is correctly set up, run the following:
3434

tutorials/hana-clients-python/hana-clients-python.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ primary_tag: software-product>sap-hana-cloud
1717
- How to create and debug a Python application that queries a SAP HANA database
1818

1919
## Intro
20-
In the 2023 Stack Overflow's annual developer survey, Python ranked 3rd in the [Most popular technologies](https://survey.stackoverflow.co/2023/#most-popular-technologies-language) section. For further information on Python, see [Introduction to Python 3](https://realpython.com/python-introduction/).
20+
In the 2023 Stack Overflow's annual developer survey, Python ranked 3rd in the [Most popular technologies](https://survey.stackoverflow.co/2023/#most-popular-technologies-language) section. For further information on Python, see [Introduction to Python 3](https://realpython.com/python-introduction/) or [The Python Tutorial](https://docs.python.org/3/tutorial/).
2121

2222
The following steps create a simple Python app that can connect to and query an SAP HANA database.
2323

@@ -233,11 +233,9 @@ The code in `pythonQuery.py` uses [PEP 249 -- Python Database API Specification]
233233
234234
235235
### Debug the application
236-
237-
238236
Visual Studio Code provides plugins for Python and can be used to debug an application.
239237
240-
1. Open Visual Studio Code. If needed, download the application [here](https://code.visualstudio.com/Download).
238+
1. If you have not already done so, download [Visual Studio Code](https://code.visualstudio.com/Download).
241239
242240
2. If you have not already done so, add the tutorial folder to the workspace by choosing **File | Add Folder to Workspace**, and then add the `HANAClientsTutorial` folder.
243241

tutorials/hana-cloud-alerts-rest-api/hana-cloud-alerts-rest-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ If you wish to access alerts and metrics for multiple instances with one API cal
319319

320320
4. Create a new file named AlertsAndMetrics2.http file with the contents below. Highlighted values are to be updated with details from the service binding created in the previous step and optionally an instance ID.
321321

322-
```HTTP[6, 9, 12, 15, 17]
322+
```HTTP[6, 9, 12, 15, 18]
323323
#REST Client variables -------------------
324324
325325
@oauth = oauth/token?grant_type=client_credentials

tutorials/hana-cloud-alerts/hana-cloud-alerts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Alerts can inform you of potential issues before they occur, such as when the nu
2222

2323
You can find details of any raised alerts through the alerts app in SAP HANA Cloud Central or by using the [REST API](hana-cloud-alerts-rest-api) (SAP HANA database). This is known as a pull approach.
2424

25-
Alternatively, alert details can be pushed to several configured channels such as email, Slack, or Microsoft Teams.
25+
Alternatively, alert details can be pushed to several configured channels such as email, Slack, or Microsoft Teams. A list of built-in events can be found at [SAP HANA Cloud Service Database Events](https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/sap-hana-cloud-service-database-events).
2626

2727
> Access help from the SAP community or provide feedback on this tutorial by navigating to the "Feedback" link located on the top right of this page.
2828

tutorials/hana-cloud-automation-cli/hana-cloud-automation-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The subaccount ID can be obtained on the BTP Cockpit Overview page for the subac
233233
![subaccount ID](subaccount-id.png)
234234

235235
#### Create an instance
236-
In order to create an instance, a JSON describing the instance is required and a plan ID.
236+
In order to create an instance, JSON describing the instance is required as well as a plan ID.
237237

238238
* Create a JSON file named **create.json** that specifies the parameters of the instance to be created. The JSON can be generated in the SAP HANA Cloud Central instance creation wizard or can come from an existing instance.
239239

@@ -640,7 +640,7 @@ Log on to Cloud Foundry using an API endpoint.
640640
![cf login](cf-login.png)
641641

642642
#### Create an instance
643-
In order to create an instance, a JSON describing the instance is required as is a service offering name and plan.
643+
In order to create an instance, JSON describing the instance is required, as well as a service offering name and plan.
644644

645645
* Create a JSON file named **create.json**.
646646

tutorials/hana-cloud-dl-clients-dot-net/hana-cloud-dl-clients-dot-net.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ primary_tag: software-product-function>sap-hana-cloud--data-lake
1717
- How to create and debug a .NET application that queries a data lake Relational Engine
1818

1919
## Intro
20-
[.NET](https://en.wikipedia.org/wiki/.NET_Core) is a free and open source software framework for Microsoft Windows, Linux and Mac operating systems and is the successor to the .NET Framework. .NET was previously known as .NET Core.
20+
[.NET](https://en.wikipedia.org/wiki/.NET_Core) is a free and open-source software framework for Microsoft Windows, Linux and Mac operating systems and is the successor to the .NET Framework. .NET was previously known as .NET Core.
2121

2222
---
2323

Loading
Loading
Loading

tutorials/hana-cloud-dl-clients-golang/hana-cloud-dl-clients-golang.md

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ primary_tag: software-product-function>sap-hana-cloud--data-lake
1616
- How to install Go
1717
- How to create and debug a Go application that queries a data lake Relational Engine
1818

19-
## Intro
20-
Go is an open source programming language developed by Google to increase productivity among programmers. For more information, see the [Go Documentation](https://golang.org/doc/).
19+
## Intro
20+
Go is an open-source programming language developed by Google to increase productivity among programmers. For more information, see the [Go Documentation](https://golang.org/doc/).
2121

2222
---
2323

@@ -31,7 +31,7 @@ go version
3131

3232
![go version linux](version2.png)
3333

34-
If Go is installed, then it will return the currently installed version, such as 1.20.4
34+
If Go is installed, then it will return the currently installed version, such as 1.21.5
3535

3636
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.
3737

@@ -43,7 +43,7 @@ On Linux, follow the instructions for the appropriate Linux version: [Installing
4343

4444
The data lake Relational Engine Client interface for Go, like the other data lake Relational Engine client interfaces (except JDBC), makes use of a C library named SQLDBC.
4545

46-
The Go driver loads the SQLDBC library named `libdbcapiHDB` using [`cgo`](https://golang.org/cmd/cgo/). For further information on the following steps, consult [Build the Go Driver](https://help.sap.com/docs/SAP_HANA_DATA_LAKE/a895964984f210158925ce02750eb580/0f3109338be048e187caa9646199e3db.html?state=DRAFT) in the SAP HANA Cloud, Data Lake Client Interfaces Reference Guide. In order to use the Go Driver, a 64-bit `gcc` compiler is required.
46+
The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https://golang.org/cmd/cgo/). For further information on the following steps, consult [Build the Go Driver](https://help.sap.com/docs/SAP_HANA_DATA_LAKE/a895964984f210158925ce02750eb580/0f3109338be048e187caa9646199e3db.html?state=DRAFT) in the SAP HANA Cloud, Data Lake Client Interfaces Reference Guide. In order to use the Go Driver, a 64-bit `gcc` compiler is required.
4747

4848
1. To check if a 64-bit `gcc` compiler is installed, run the following command:
4949

@@ -61,7 +61,7 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [`cgo`](https
6161
>
6262
![Edit Environment Variables](editEnvironmentVariables.png)
6363
64-
Look for the `Path` environment variable and double click to edit. Select **Browse** and manually browse through your File Explorer to find the bin folder
64+
Look for the `Path` environment variable and double click to edit. Select **Browse** and manually browse through your File Explorer to find the bin folder.
6565
6666
![Add bin to path](add-bin-to-path.png)
6767
@@ -79,42 +79,33 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [`cgo`](https
7979
8080
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.
8181
82-
3. Set the required environment variables.
83-
84-
>On Windows, navigate to the start menu and search for **system** environment variables.
85-
Optionally, you can also use the **SETX** command in command prompt to set a Windows environment variable. For example, `SETX CGO_LDFLAGS C:\SAP\hdlclient\IQ-17_1\Bin64\dbcapi.dll`. Note that this will set a user variable, not a system variable.
82+
3. Set the `CGO_LDFLAGS` environment variable to point to the location of the HDLRE client library as shown below and set the `LD_LIBRARY_PATH` if needed.
8683
87-
88-
On Linux, open the .bash_profile
84+
On Windows, add a **NEW** variable. Set the variable name to **CGO_LDFLAGS** and the value as the location of `dbcapi` library: `C:\SAP\dlclient\IQ-17_1\Bin64\dbcapi.dll`
8985
90-
```Shell (Linux)
91-
pico ~/.bash_profile
92-
```
86+
![Set Environment Variables](setEnvVar.png)
9387
94-
4. Set the `CGO_LDFLAGS` environment variable to point to the location of the HDLRE client library as shown below, and set the `LD_LIBRARY_PATH` if needed.
88+
>It is also possible on Microsoft Windows to set this using the SETX command from a shell.
9589
96-
On Windows, add a **NEW** System Variable. Set the variable name to **CGO_LDFLAGS** and the value as the location of `dbcapi` library: `C:\SAP\hdlclient\IQ-17_1\Bin64\dbcapi.dll`
9790
98-
![Set Environment Variables](setEnvVar.png)
99-
100-
On Linux, add the following lines to the bash_profile.
91+
On Linux, add the following lines to the `.bash_profile`.
10192
10293
```Shell (Linux)
10394
export CGO_LDFLAGS=$HOME/sap/dlclient/IQ-17_1/lib64/libdbcapi_r.so
10495
export LD_LIBRARY_PATH=$HOME/sap/dlclient/IQ-17_1/lib64
10596
```
10697
![.bash_profile contents](bashProfileAfterCGO.png)
10798
108-
5. Navigate to the driver folder and create a Go module.
99+
4. Navigate to the driver folder and create a Go module.
109100
110101
```Shell (Windows)
111-
cd C:\SAP\hdlclient\IQ-17_1\SDK\golang\SAP\go-hdlre\driver
102+
cd %IQDIR17%\sdk\golang\SAP\go-hdlre\driver
112103
go mod init "SAP/go-hdlre/driver"
113104
go mod tidy
114105
```
115106
116107
```Shell (Linux)
117-
cd ~/sap/dlclient/IQ-17_1/sdk/golang-hdlre/src/SAP/go-hdlre/driver
108+
cd $IQDIR17/sdk/golang-hdlre/src/SAP/go-hdlre/driver
118109
go mod init "SAP/go-hdlre/driver"
119110
go mod tidy
120111
```
@@ -135,7 +126,8 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [`cgo`](https
135126
cd ~/DataLakeClientsTutorial/go
136127
pico goQuery.go
137128
```
138-
2. Add the code below to `goQuery.go`:
129+
130+
2. Add the code below to `goQuery.go` and then modify the connectString variable.
139131
140132
```Go Code
141133
package main
@@ -150,7 +142,7 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [`cgo`](https
150142
151143
func main() {
152144
//specify the connection parameters
153-
connectString := "hdlre://User1:[email protected]ca10.hanacloud.ondemand.com:443?enc='TLS{tls_type=rsa;direct=yes}'"
145+
connectString := "hdlre://User1:[email protected]xxxx.hanacloud.ondemand.com:443?enc='TLS{tls_type=rsa;direct=yes}'"
154146
155147
fmt.Println("Connect String is " + connectString)
156148
@@ -207,7 +199,7 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [`cgo`](https
207199
>Make any necessary changes to ensure the path to the driver folder is correct.
208200
209201
```Code (Windows)
210-
replace SAP/go-hdlre/driver v0.1.0 => C:\SAP\hdlclient\IQ-17_1\SDK\golang\SAP\go-hdlre\driver
202+
replace SAP/go-hdlre/driver v0.1.0 => C:\SAP\dlclient\IQ-17_1\SDK\golang\SAP\go-hdlre\driver
211203
require SAP/go-hdlre/driver v0.1.0
212204
```
213205
@@ -230,8 +222,6 @@ For more information on the API's used, consult the SAP HANA Cloud, data lake co
230222

231223

232224
### Debug the application
233-
234-
235225
Visual Studio Code provides plugins for Go and can be used to debug an application.
236226

237227
1. If you have not already done so, download [Visual Studio Code](https://code.visualstudio.com/Download).
@@ -264,7 +254,7 @@ Visual Studio Code provides plugins for Go and can be used to debug an applicati
264254

265255
### Knowledge check
266256

267-
Congratulations! You have now created and debugged a Go application that connects to and queries an data lake Relational Engine.
257+
Congratulations! You have now created and debugged a Go application that connects to and queries a data lake Relational Engine.
268258

269259

270260

Loading
Loading
Binary file not shown.
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)