Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ In order for the shell to recognize that the .NET SDK is installed and for any `
</ItemGroup>
```

Note that if the developer licensed version of the data lake Client was installed for Linux, the path might be similar to /home/dan/sap/hdlclient/sdk/dotnet/Sap.Data.SQLAnywhere.Core.v2.1.dll
Note that if the developer licensed version of the data lake Client was installed the path might be similar to

```
C:\SAP\hdlclient\sdk\dotnet\Sap.Data.SQLAnywhere.Core.v2.1.dll
or
/home/dan/sap/hdlclient/sdk/dotnet/Sap.Data.SQLAnywhere.Core.v2.1.dll
```

![dotNET.csproj code](dotNET-csproj-code.png)

Expand Down
Binary file modified tutorials/hana-cloud-dl-clients-golang/add-bin-to-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ On Linux, follow the instructions for the appropriate Linux version: [Installing
### Configure the environment
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.

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.
The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https://golang.org/cmd/cgo/). For further information on the following steps, consult [Go (golang) Driver](https://help.sap.com/docs/hana-cloud-data-lake/client-interfaces/go-golang-driver) 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.

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

Expand Down Expand Up @@ -77,7 +77,7 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https:/

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 HDLRE client 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 HDLRE client library as shown below.

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`

Expand All @@ -90,15 +90,14 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https:/

```Shell (Linux)
echo $LD_LIBRARY_PATH
echo $CGO_LDFLAGS
pico .bash_profile
```

```Shell (Linux)
export LD_LIBRARY_PATH=$HOME/sap/dlclient/IQ-17_1/lib64
export LD_LIBRARY_PATH=$HOME/sap/hdlclient/lib64
export CGO_LDFLAGS=$HOME/sap/dlclient/IQ-17_1/lib64/libdbcapi_r.so
export CGO_LDFLAGS=$HOME/sap/hdlclient/lib64/libdbcapi_r.so
export LD_LIBRARY_PATH=$HOME/sap/dlclient/IQ-17_1/lib64
export LD_LIBRARY_PATH=$HOME/sap/hdlclient/lib64
```
![.bash_profile contents](bashProfileAfterCGO.png)

Expand All @@ -121,7 +120,7 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https:/
### Create a Go application that queries an SAP data lake Relational Engine
1. In a shell, create a folder named `go`, enter the newly created directory, and open a file named `goQuery.go` in an editor.

```Shell (Microsoft Windows)
```Shell (Windows)
mkdir %HOMEPATH%\DataLakeClientsTutorial\go
cd %HOMEPATH%\DataLakeClientsTutorial\go
notepad goQuery.go
Expand Down Expand Up @@ -201,10 +200,11 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https:/

4. Add the code below to `go.mod` under the go 1.23.4 (version) line:

>Make any necessary changes to ensure the path to the driver folder is correct.
>Ensure you have the correct path to the driver folder. The path depends on your installation. Note that two example locations are provided. Choose the one that's closest to your installation and edit it if necessary.

```Code (Windows)
replace SAP/go-hdlre/driver v0.1.0 => C:\SAP\dlclient\IQ-17_1\SDK\golang\SAP\go-hdlre\driver
replace SAP/go-hdlre/driver v0.1.0 => C:\SAP\hdlclient\sdk\golang\SAP\go-hdlre\driver
require SAP/go-hdlre/driver v0.1.0
```

Expand All @@ -216,12 +216,17 @@ The Go driver loads the SQLDBC library named `libdbcapiHDB` using [cgo](https:/

![go.mod contents](goModContents.png)

5. Run the application:
5. Run the application or build and run the application:

```Shell
go run goQuery.go
```

```Shell Microsoft Windows
go build goQuery.go
goQuery.exe
```

![Result](results.png)

For more information on the API's used, consult the SAP HANA Cloud, data lake connection specific properties at [Connect from Go to Data Lake Relational Engine](https://help.sap.com/docs/SAP_HANA_DATA_LAKE/a895964984f210158925ce02750eb580/0b55e305d26941c191c71eaa07f72bb5.html), [Go Database/SQL Tutorial](http://go-database-sql.org/index.html), and [Package SQL](https://golang.org/pkg/database/sql/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ primary_tag: software-product-function>sap-hana-cloud--data-lake
---

### Install a JDK
Ensure that you have a Java Development Kit (JDK) installed and make sure it is accessible from your path. Details of the driver and supported versions can be found at [JDBC Drivers](https://help.sap.com/viewer/a894a54d84f21015b142ffe773888f8c/latest/en-US/3bd02ce86c5f101482b78476939fb83a.html) and [Oracle Java SE Support Roadmap](https://www.oracle.com/java/technologies/java-se-support-roadmap.html).
Ensure that you have a Java Development Kit (JDK) installed and make sure it is accessible from your path. Further details of the driver can be found at [JDBC Driver](https://help.sap.com/docs/hana-cloud-data-lake/client-interfaces/jdbc-driver).

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

Expand All @@ -34,15 +34,15 @@ javac -version

If these commands fail, ensure that the folder they are located in is included in your path.

The following command will install Java on openSUSE Leap 15.4.
For Linux, the following command will install Java on openSUSE Leap 15.4.

```Shell (Linux)
sudo zypper install java-11-openjdk-devel
```


### The data lake Relational Engine JDBC driver
The data lake Relational Engine JDBC driver is a type 2 driver, which means it has a native (non-Java) component. For additional details see [Type 2 driver – Native-API driver](https://en.wikipedia.org/wiki/JDBC_driver#Type_2_driver_%E2%80%93_Native-API_driver). The driver is located in `%IQDIR17%\Java\sajdbc4.jar` on Microsoft Windows and `$IQDIR17/java/sajdbc4.jar` on Linux. The native component is at `%IQDIR17%\Bin64\dbjdbc17.dll` on Microsoft Windows and `$IQDIR17\lib64\libdbjdbc17.so` on Linux.
The data lake Relational Engine JDBC driver is a type 2 driver, which means it has a native (non-Java) component. For additional details see [Type 2 driver – Native-API driver](https://en.wikipedia.org/wiki/JDBC_driver#Type_2_driver_%E2%80%93_Native-API_driver). The driver is located in `%IQDIR17%\java\sajdbc4.jar` on Microsoft Windows and `$IQDIR17/java/sajdbc4.jar` on Linux. The native component is at `%IQDIR17%\Bin64\dbjdbc17.dll` on Microsoft Windows and `$IQDIR17\lib64\libdbjdbc17.so` on Linux.

See [data lake Relational Engine JDBC driver](https://help.sap.com/docs/hana-cloud-data-lake/developer-guide-for-data-lake-relational-engine/jdbc-drivers) for additional details.

Expand Down Expand Up @@ -104,7 +104,7 @@ See [data lake Relational Engine JDBC driver](https://help.sap.com/docs/hana-clo
}
```

3. Compile the `.java` file into a `.class` file using the following command:
3. Save and close `JavaQuery.java`. Compile the `.java` file into a `.class` file using the following command:

```Shell (Microsoft Windows)
javac -cp %IQDIR17%\Java\sajdbc4.jar;. JavaQuery.java
Expand Down
34 changes: 23 additions & 11 deletions tutorials/hana-cloud-dl-clients-node/hana-cloud-dl-clients-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Ensure you have Node.js installed and check its version. Enter the following com
node -v
```

If Node.js is installed, the currently installed version is returned, such as v20.10.0.
If Node.js is installed, the currently installed version is returned, such as v22.16.0.

If Node.js is not installed, download the long-term support (LTS) version of Node.js from [Download Node.js](https://nodejs.org/en/download/).
If Node.js is not installed, download the long-term support (LTS) version of the Node.js installer from [Download Node.js](https://nodejs.org/en/download/).

>If an install for Node.js is not provided on Linux, you may choose to install it via a package manager. For more details, please navigate to [this link](https://nodejs.org/en/download/package-manager/).

Expand All @@ -44,6 +44,11 @@ If Node.js is not installed, download the long-term support (LTS) version of Nod

### Install the data lake Relational Engine client for Node.js
The Node.js driver covered in this tutorial is `@sap\iq-client` which supports the latest Node.js versions and includes a promise library. An alternate driver is the [SQL Anywhere](https://github.com/sqlanywhere/node-sqlanywhere) driver.
The SQL Anywhere driver can be installed by running this command.

```Shell (Microsoft Windows)
npm install sqlanywhere
```

1. Add the dependencies to the driver.

Expand All @@ -57,7 +62,7 @@ The Node.js driver covered in this tutorial is `@sap\iq-client` which supports t
npm install
```

2. Create a folder named `node` and enter the newly created directory.
2. Open a new Shell and create a folder named `node` and enter the newly created directory.

```Shell (Microsoft Windows)
mkdir %HOMEPATH%\DataLakeClientsTutorial\node
Expand Down Expand Up @@ -112,7 +117,7 @@ The Node.js driver covered in this tutorial is `@sap\iq-client` which supports t
const { PerformanceObserver, performance } = require('perf_hooks');
var t0;
var util = require('util');
var datalakeIQ = require('@sap/iq-client');
var datalakeRE = require('@sap/iq-client');

var connOptions = {
host: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX.iq.hdl.trial-XXXX.hanacloud.ondemand.com:443',
Expand All @@ -122,7 +127,7 @@ The Node.js driver covered in this tutorial is `@sap\iq-client` which supports t
};

//Synchronous example querying a table
var connection = datalakeIQ.createConnection();
var connection = datalakeRE.createConnection();
connection.connect(connOptions);

var sql = 'select TITLE, FIRSTNAME, NAME from HOTELS.CUSTOMER;';
Expand All @@ -146,7 +151,7 @@ The Node.js driver covered in this tutorial is `@sap\iq-client` which supports t

Two examples showing the drivers methods being used asynchronously are shown in the next two steps.

>To enable debug logging of the SAP IQ Node.js client, enter the following command and then rerun the app.
>To enable debug logging of the Node.js client, enter the following command and then rerun the app.

>```Shell (Microsoft Windows)
>set DEBUG=*
Expand Down Expand Up @@ -200,7 +205,7 @@ Asynchronous programming enables non-blocking code execution which is demonstrat
const { PerformanceObserver, performance } = require('perf_hooks');
var t0;
var util = require('util');
var datalakeIQ = require('@sap/iq-client');
var datalakeRE = require('@sap/iq-client');

var connOptions = {
host: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX.iq.hdl.trial-XXXX.hanacloud.ondemand.com:443',
Expand All @@ -210,7 +215,7 @@ Asynchronous programming enables non-blocking code execution which is demonstrat
};

//Asynchronous example calling a stored procedure with callbacks
var connection = datalakeIQ.createConnection();
var connection = datalakeRE.createConnection();

connection.connect(connOptions, function(err) {
if (err) {
Expand Down Expand Up @@ -296,7 +301,7 @@ The Node.js driver for the data lake Relational Engine client provides support f
const { PerformanceObserver, performance } = require('perf_hooks');
var t0;
var util = require('util');
var datalakeIQ = require('@sap/iq-client');
var datalakeRE = require('@sap/iq-client');
var PromiseModule = require('@sap/iq-client/extension/Promise.js');

var connOptions = {
Expand All @@ -308,7 +313,7 @@ The Node.js driver for the data lake Relational Engine client provides support f
};

//Asynchronous example calling a stored procedure that uses the promise module
var connection = datalakeIQ.createConnection();
var connection = datalakeRE.createConnection();
var statement;

PromiseModule.connect(connection, connOptions)
Expand Down Expand Up @@ -379,7 +384,7 @@ The Node.js driver for the data lake Relational Engine client provides support f


### Debug the application
Visual Studio Code can run and debug a Node.js application. It is a lightweight but powerful source code editor which is available on Windows, macOS and Linux.
Visual Studio Code can run and debug a Node.js application. It is a lightweight but powerful source code editor which is available on Windows, macOS and Linux. Ensure that Node.js is added to your path in environment variables such as C:\Program Files\nodejs.

1. If required, download [Visual Studio Code.](https://code.visualstudio.com/Download).

Expand All @@ -397,6 +402,13 @@ Visual Studio Code can run and debug a Node.js application. It is a lightweight

![VS Code Debugging](debugging.png)

If "Can't find Node.js binary 'node': path does not exist" error pops up, open a Shell and run the following command.
```Shell
code .
```
Then restart VSCode.


### Knowledge check
Congratulations! You have created and debugged a Node.js application that connects to and queries an SAP data lake Relational Engine database.

Expand Down
Binary file modified tutorials/hana-cloud-dl-clients-node/npm-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-dl-clients-odbc/ODBC-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-dl-clients-odbc/drivers-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The ODBC Data Source Administrator can be used to view the installed ODBC driver

![Add ODBC user data source](ODBC-add.png)

5. Select **SAP IQ** and click **Finish**.
5. Select **SAP HANA Cloud, data lake Relational Engine** and click **Finish**.

![New data source](Create-new-data-source-1.png)

Expand Down
Binary file modified tutorials/hana-cloud-dl-clients-odbc/start-odbc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-dl-clients-overview/feedback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading