cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Connection NEO HANA MDC db from Python

Former Member
0 Likes
2,000

Hi Experts,

I am trying to connect a SCP HANA DB which is neo environment from Python. I am using 'Python any where' platform to code.

Python code -

from hdbcli import dbapi


connection = dbapi.connect(host='vsXXXXXXX.pXX.oX.sap.bXz',
                           port=30013,
                           user='DBUSER',
                           password='PASSWORD'
                           )


print(connection.isconnected())

The response from python anywhere is -

Traceback (most recent call last): File "/home/LEONARDOMFG/connectHDB.py", line 13, in <module>password='PASSWORD'hdbcli.dbapi.Error: (-10719, "Connect failed (invalid SERVERNODE ':30052')")

Please help me out on what else is required?

View Entire Topic
Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes

You need to open a tunnel to that DB hosted in the cloud, like here: https://help.sap.com/viewer/d4790b2de2f4429db6f3dff54e4d7b3a/Cloud/en-US/6930850a8f9a40489c01ed1aa38...

Former Member
0 Likes

I have used the below syntax to open the tunnel:

neo open-db-tunnel -h vXXXXXXXXX.od.sap.biz -u S0XXXXXXXX_1 -a aXXXXXXXe --id JXX

The error I am getting is -

(!) ERROR; Could not connect to host: https://services.vXXXXXXXX.od.sap.biz/services/v1/instances/aXXXXXXXe/persistence/v3/dbtunnel/schema.... Make sure your proxy settings are correct
If you need help, provide the output of the command and attach the log directory [C:\Users\1USER0\Downloads\neo-java-web-sdk-3.106.14.2\tools\log]

The issue is still there.

Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes

sabarna.chatterjee1993 , `vXXXXXXXXX.od.sap.biz` is the internal host name, not something you can see from the public internet.

The `host` is the SCP host of your account, like `hanatrial.ondemand.com` for an SCP Trial account.

Former Member
0 Likes

HI @vitaliy.rudnytskiy,

Now I am getting below error:

(!) ERROR; SSL error when connecting to https://services.jXXXXXXXX.hana.ondemand.com/services/v1/instances/aXXXXXXXe/persistence/v3/dbtunnel...; server certificate might be invalid or untrusted
If you need help, provide the output of the command and attach the log directory [C:\Users\1USER0\Downloads\neo-java-web-sdk-3.104.18 (1)\tools\log]

I have tested that one as well - jXXXXXXXX.hana.ondemand.com for the python code.

Please find the below screenshot:

Please suggest what I need to do.

Vitaliy-R
Developer Advocate
Developer Advocate

There are two separate steps:

  1. Open a tunnel to your database in Neo. It becomes visible as localhost:30015 then.
  2. Connect db client (like Python) to HANA db using localhost:30015 host.

You can find an example of this approach in https://blogs.sap.com/2019/04/16/connect-to-sap-hana-from-scp-neo-trial-from-sap-data-hub-developer-... post.