Group Abstract Group Abstract

Message Boards Message Boards

0
|
247 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Using DatabaseReference for SAP HANA database

Posted 1 month ago

Hello all,

my name is Dirk and I had the chance to attend the online training "Mastering Relational Databases with Wolfram Language and SQL" held by Dimitar Krastev some weeks ago.

And during my x-mas break I wanted to apply some of the steps provided in the training to access a SQL DB. In my case it this SQL DB is a HANA DB from SAP. Nothing fancy from the perspective to access it with ODBC or JDBC in python or R.

In the past I accessed a SAP DB by using the DatabaseLink but now I would like to understand how to use "DatabaseReference" with SQL (ExternalEvaluate) and EntittyStore (EntityValue).

Maybe someone can help me by some hints?

The issue is it is said in the training material:
... To create a database reference, we can use the built-in DatabaseReference function. Note: if you are using a server-based database, simply replace the File handler with the URL of your database:

I made several attempts to get it up and running but without success.

To start with I added to the notebook:

    Needs["JLink`"]
    AddToClassPath["/home/dirk/.Wolfram/DatabaseResources/ngdbc.jar"]

When using

DatabaseReference[URL["jdbc:sap://MATHEMATICA:<MySecretPassword>@hxehost:39015/HXE"]]

The error message is:

Invalid reference specification:
jdbc:sap://MATHEMATICA:<MySecretPassword>@hxehost:39015/HXE

When using:

DatabaseReference[URL["sap://MATHEMATICA:<MySecretPassword>@hxehost:39015/HXE"]]

or

DatabaseReference["sap://MATHEMATICA:<MySecretPassword>@hxehost:39015/HXE"]

I get a DatabaseReference with an ID and everything looks fine.

Unfortunately this does not seems to be the case.

Because when trying to proceed with:

RegisterExternalEvaluator["SQL" -> conn]

The response is:

Invalid backend "sap". Possible choices are: PostgreSQL,SQLite,MySQL,Oracle,MicrosoftSQL.

I assume that SAP HANA is not a considered DB in Wolfram universe yet by looking into "Connection.m":

SystemOpen@
FileNameJoin[{$InstallationDirectory, "SystemFiles", "Links", 
"Databases", "Databases", "Schema", "Connection.m"}]

In case I´m using:

RegisterExternalEvaluator["SQL-JDBC" -> conn]

The respons is:
JDBC::classnotfound
And when I´m following the documentation I´m back in the old world with DatabaseLink.

Can someone please tell me what are the appropriate key words to be used in the association and what needs to be considered to avoid the "JDBC::classnotfound" error please?

The outdated approach by using

conn = OpenSQLConnection[] 

is working. Unfortunately this was not what I was looking for.

How can I overcome this? Is there a possibility for this when using SAP HANA DB?

Thank you for your help in advance.

Br.,
Dirk

P.S. For HANA DB it is common to use
Driver Name: HANA
Class Name: com.sap.db.jdbc.Driver
URL template: jdbc:sap://{host}[:{port}]

POSTED BY: Di O
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard