Skip to Content

[Update: April 5th, 2016 –  The Live3 on HCP tutorial series was created using the SAP HANA Cloud Platform free developer trial landscape in January 2015. The HCP landscape has significantly evolved over the past year. Therefore one may encounter many issues while following along with the series using the most recent version of the free developer trail edition of HCP.]


In this tutorial video Philip Mugglestone from the SAP HANA Academy shows how to configure a tunnel that enables the node.js application to communication directly with our SAP HANA Cloud Platform trial instance. Check out the tutorial video below.

Screen Shot 2015-03-04 at 3.36.59 PM.png

(0:15 – 1:05) Tunneling Overview

When using the SAP HANA Cloud Platform trial edition it is not possible for node.js to directly connect to the SAP HANA database. Therefore we need to setup a database tunnel using the previously installed SDK to connect directly to the SAP HANA database.

(1:05 – 5:20) How to Setup the HCP Tunnel

First open a command prompt on the tools folder of the SAP HANA SDK we previously installed and placed in the C drive. Type in open-db-tunnel –h hanatrial.ondemand.com – i dev – a – p123456789trial – u p123456789 and run the command.


h = Host name

i = Instance Name

a = Account Name (Your personal P number)

u = Username (P number without trial)

After entering your password the tunnel will successfully open.

Screen Shot 2015-03-04 at 3.41.33 PM.png

Now we have the information needed to connect from node.js. This includes the host name, instance number, JDBC port number, user name, password and schema name. Note the password will change each time you open and close the tunnel. The tunnel will automatically close after 24 hours.

Now copy the information from tunnel and paste it into the corresponding lines of app.js code.

Screen Shot 2015-03-04 at 3.42.34 PM.png


Follow along with the Live3 course here.


SAP HANA Academy over 900 free tutorial videos on using SAP HANA and SAP HANA Cloud Platform.


Follow @saphanaacademy

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Christoforos Verras

    hi Tom !

    I have a question – quite complicated.

    I have my tunnel opened but whenever i try to see what’s in my tables i can’t.

    If i close the tunnel, i get the error “Unable to get data provider”.

    I log off of my system – then log on a few times and then i can see what’s in there.

    Any suggestions?

    Thanks

    Christoforos Verras

    (0) 
    1. Tom Flanagan Post author

      Hi Christoforos,

      That’s a very strange error. Philip nor myself has ever encountered it when using the tunnel.

      I would suggest, first, to recheck to ensure that you transcribed all of the correct information form the tunnel (JDBC port number, schema name, password etc.) and the Twitter keys and secrets to the app.js SQL code.

      Then make sure that you have the most up to date version of the HCP SDK installed.

      Also, there could be some compatibility issues with running Eclipse and the node.js tunnel at the same time. Close Eclipse, start the tunnel connection and then reopen Eclipse.

      Hope these suggestions are helpful in solving your error.

      Best Regards,

      Tom

      (0) 
      1. Christoforos Verras

        Hi Tom,

        thanks so much for your answer !

        Do you mean that while you are tracking – insterting tweets to HANA, you can open an SQL Command Line and write a select statement ?

        Everything is correct since it is working and inserting the tweets into the table – Username / Password etc.

        The HCP SDK – i don’t get that..

        I will do the Close eclipse procedure but i don’t think it will work either.

        Thanks,

        Christoforos Verras

        (0) 

Leave a Reply