Mar 9, 2015

Database Access in the SAP HANA Cloud failed with invalid username/password

In the SAP HANA Cloud you can select in the cockpit ( ) which database should be used.

The HANA Database doesn't support native sequences and the source I'm deploying is using JPA native

In the cockpit you can create a MaxDB Instance and assign this db instance as the default to the deployment.

To access this database you have to install the Java EE WebProfile 6 SDK kit  ( ).

The neo-Tool from the SDK allows to open a db-tunnel to the HANA MaxDB-Instance:

./  open-db-tunnel -a <account>trial -h -u <account> -i <DB-Schema- Instance>
SAP HANA Cloud Platform Console Client

Password for your user: 

Opening tunnel...

Tunnel opened.

Use these properties to connect to your schema:
  Host name        : localhost
  Database type    : MaxDB
  JDBC Url         : jdbc:sapdb://localhost:7200/J04
  User             : <User returned from the open-db-tunnel>
  Password         : <password for the returned user>

This tunnel will close automatically in 24 hours on Mar 10, 2015 at 1:46 PM or when you close the shell.
Press ENTER to close the tunnel now.

When this tunnel is established. ( In my case I have to restart more times, because there seems to be some ports blocked in the firewall )

In Eclipse Luna just open the db view and connect with the MaxDB driver and the data given in the open-db-tunnel above. In my case a always got an error about an invalid username/password. 

The reason here is that I used an old JDBC-Driver. Now I downloaded the Version 7.8 of MaxDB and 
the contained JDBC-Driver now allows to access the database.