cancel
Showing results for 
Search instead for 
Did you mean: 

PYTHON and HCP Connectivity Issue

Former Member
0 Kudos

I am trying to establish a connection with my HCP trail account from python but facing the below issue:

The code snippet i used to establish this connection is :

import dbapi

conn = dbapi.connect( 'hanatrial.ondemand.com' , 30015, 'p1942054738', 'xxxxxx')

print ( conn.isconnected())

Please note :

- i have placed this code under python folder of hdbclient.

- I have copied these files into the Lib folder of python

* __init__.py, dbapi.py, resultrow.py

* pyhdbcli.pdb, pyhdbcli.pyd

Please let me know what am i missing to establish a connection between HCP and python.

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

No really sure what you are trying to do with that connection string. If you wanna connect to a HANA DB (MDC or shared) that will not work, cause at the host an port do not exist in that way.

You either have to open a DB tunnel using the Cloud Platform console client (open-db-tunnel) or set up a service channel using the SAP Cloud Platform Connector Cloud Connector. The 2nd option is the preferred one. With the Cloud Connector you connect to the Cloud Platform using your Cloud Platform Account name and user. Then you can define a service channel to your HANA DB, using your HANA credentials.

Consider that you have used the Cloud Platform user name in your example which will not work (except you have defind in your HANA DB a user with the same name).

Regards,
Florian