Connect to SAP HANA 2.0 using JDBC

I’m trying to connect to SAP HANA 2.0 using JDBC. I took the driver ngdbc.jar from the Eclipse plugin that I installed in Windows.

Problem is that I always get the same error [Connection refused: connect], -813 even when I set a random IP address in the connection string.


You seem to try to connect to the SystemDB of a multi-database-container (MDC) setup of HANA. As the SystemDB is special and don’t run in an indexserver process, you would use a different port (…13) to connect to it. However, usually one would want to connect to a tenant database instead. For this, the jdbc URL needs to contain then name of the database as a parameter. The HANA documentation contains the details on this.

Lars, if I use port 39013 instead of 39015 everything works perfectly, including user SYSTEM and other users, why is that?
That’s the external port for the nameserver process that runs the SystemDB. I highly recommend to have a read of the documentation.

本文作者: GavinDong

版权属于: GavinDong博客


如果使用过程中遇到问题,可 **点击此处** 交流沟通。