title: SAP HANA hostname jdbc driver
body: <p>I am trying to connect my java programme to the hana database. However, I am unable to do so because  I have to connect my programme to the database through a url which I don't know. I registered for a hana trial online: <a href="https://account.hanatrial.ondemand.com" rel="nofollow">https://account.hanatrial.ondemand.com</a>. I created the account and the database and added it to the eclipse hana tools. How do I retrieve the url/servername/ipaddress that I have to use in place of HDB_URL</p>
  
  <p>I used this to connect the hana cloud system <a href="http://saphanatutorial.com/add-sap-hana-cloud-system-in-hana-studio-or-eclipse" rel="nofollow">http://saphanatutorial.com/add-sap-hana-cloud-system-in-hana-studio-or-eclipse</a></p>
  
  <p>And I am trying to do this <a href="http://saphanatutorial.com/sap-hana-text-analysis-using-twitter-data/" rel="nofollow">http://saphanatutorial.com/sap-hana-text-analysis-using-twitter-data/</a></p>
  
  <pre><code>package com.saphana.startupfocus.util;
  
  import java.sql.*;
  import com.saphana.startupfocus.config.Configurations;
  
  public class HDBConnection {
  public static Connection connection = null;
  
  public static Connection getConnection() {
      try {
          if(null == connection){
              connection = DriverManager.getConnection(Configurations.HDB_URL,
                      Configurations.HDB_USER, Configurations.HDB_PWD);
          }
      } catch (SQLException e) {
          e.printStackTrace();
      }
      return connection;
  }
  
  // Test HDB Connection 
  public static void main(String[] argv) throws ClassNotFoundException {
  
      connection = HDBConnection.getConnection();
      if (connection != null) {
          try {
              System.out.println("Connection to HANA successful!");
  
              Statement stmt = connection.createStatement();
              ResultSet resultSet = stmt
                      .executeQuery("Select 'helloworld' from dummy");
              resultSet.next();
              String hello = resultSet.getString(1);
              System.out.println(hello);
  
          } catch (SQLException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>}</p>