Skip to Content
Author's profile photo Former Member

How to connect to SAP Hana trial Cloud Instance through JDBC

Hi All,

The purpose of this document is to provide the concrete steps for connecting to SAP Hana Trial Instance on the cloud from your java program through JDBC.


  • Eclipse plugin for Hana/ Hana Studio
  • Download Hana Client
  • Download Hana SDK.


  • You have already connected to the Hana trial instance from Eclipse.

For JDBC connection, you need to establish a database tunnel.

If you have connected to you Hana cloud instance through eclipse, it has already done so.

But, the logon credentials are not available in Eclipse

To fetch the logon credentails, go the place where you have the Hana SDK and execute the following command.


In the above command, p1941173713trial is the account name and p1941173713 is the username for your Hana cloud instance.(It will prompt for you HCP password)

Please note the username and password.

The password is a transient one.. for more information refer to the online help.

Now , in your java program, user the username and password from above to connect using JDBC.

Please make sure that you have added the ngdbc.jar in the CLASSPATH of your java program.

ngdbc.jar has the SAP HANA JDBC driver and is available as part of the Hana client in the following location –



Connection connection = null;

  try {                

  connection = DriverManager.getConnection(


  } catch (SQLException e) {

  System.err.println(“Connection Failed. User/Passwd Error?”);




Alternative you can use the URL provided in the neo command above

connection = DriverManager.getConnection(



Hopefully, this information will be useful for some people

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Is this concept still working..? I’m trying to conenct to HANA DB but its giving me java heap space issue. I’m using the same syntax for creating connection. Please help. This is how i'm trying to conenct. Please help.

      con = DriverManager.getConnection(
      "jdbc:sap://<IP Address>:Portnum/'db name","username","password");

      Author's profile photo Former Member
      Former Member

      what is the ip address for sap cloud trial