Skip to Content
0

PYTHON and HCP Connectivity Issue

May 10, 2017 at 10:07 AM

71

avatar image

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.

capture.png (19.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Florian Pfeffer
May 10, 2017 at 07:25 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded