Setting up a JDBC connection to remote SAP HANA system

JDBCSAPSAP HANA

You are using the correct Port number for instance number “00”. Port number 300315, here 00 represents instance number of your HANA system.

Try using HANA client jar file ngdbc.jar instead of SAP Jar file.

try {
   Class.forName("com.sap.db.jdbc.Driver");
   String url ="jdbc:sap://xx.x.x.xxx:30015/DBNAME"; //IP Address of HANAsystem followed by Port number
   String user ="user";
   String password = "password";
   Connection cn = java.sql.DriverManager.getConnection(url, user, password);
   ResultSet rs = cn.createStatement().executeQuery("CALL Test.STORED_PROC");
   // ...Enter the action here
} catch(Exception e) {
   e.printStackTrace();
}
raja
Published on 14-Dec-2017 10:39:07
Advertisements