cancel
Showing results for 
Search instead for 
Did you mean: 

Host Unknown: Connect to SAP Hana using JDBC url from local java springboot application

sukhpreet_k68
Explorer
0 Kudos

I need to connect to SAP Hana (running on Neo cloud) from my local Java Spring Boot application using STS (runs on eclipse 2018-12; Cloud Platform Tools not available).

My pom.xml has dependency com.sap.cloud.db.jdbc > ngdbc

Using application properties:

spring.datasource.url=jdbc:sap://hana-***:<port>
spring.datasource.username=<username>
spring.datasource.password=<password>
spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.HANAColumnStoreDialect
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

But the application startup is failing with com.sap.db.jdbc.exceptions.JDBCDriverException (unknown host).

Any suggestions on what could be missing?

View Entire Topic
Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos

Hello,

Neo's hostname is not visible in public internet. To be able to connect local app to a HANA db in Neo you need to open a tunnel: https://help.sap.com/docs/BTP/ea72206b834e4ace9cd834feed6c0e09/9e3f90f2ead74229ac5c8848ed5bf292.html

Regards.

sukhpreet_k68
Explorer

Thanks for the reply! I didn't get to try this method though. Cloud Connector with properties mentioned in comment of the other answer worked for me.