- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Integrate node.js with SAP HANA system
You can insert data into HANA database using node.js. You can also connect to SAP HANA database via JDBC driver.
To connect via JDBC, you need to install JDBC driver ngdbc.jar. This driver is installed as part of SAP HANA client installation. Ngdbc.jar file is available at this location −
C:\Program Files\sap\hdbclient\ on Windows platforms /usr/sap/hdbclient/ on Linux and UNIX platforms
Next is to add ngdb.jar to the classpath and write a Java program to connect to a database and execute SQL command.
jdbc:sap://myServer:30015/?autocommit=false
You can also add one or more failover servers by adding additional hosts.
Example
Following is an example of connecting SAP HANA Server −
import java.sql.*; public class jdemo { public static void main(String[] argv) { Connection connection = null; try { connection = DriverManager.getConnection( "jdbc:sap://myhdb:30015/?autocommit=false",uname,mypwrd); } catch (SQLException e) { System.err.println("Connection Failed. User/Passwd Error?"); return; } if (connection != null) { try { System.out.println("Connection to HANA successful!"); Statement stmt = connection.createStatement(); ResultSet resultSet = stmt.executeQuery("Select 'hello world' from dummy"); resultSet.next(); String hello = resultSet.getString(1); System.out.println(hello); } catch (SQLException e) { System.err.println("Query failed!"); } } } }
- Related Articles
- Downloading SAP.NET connector to integrate .NET application with SAP system
- Standard way to integrate SAP with external system like .NET application
- Starting SAP HANA Studio with immediate system logon
- Searching a SAP HANA system in HANA Studio System view
- Migrating to SAP HANA system
- Architecture of SAP HANA system
- Data Compression in SAP HANA system
- Lock down of SAP HANA system
- Index server in SAP HANA system
- Checking System limits in SAP HANA
- Current alerts in SAP HANA system
- Checking performance of SAP HANA system
- Checking version of SAP HANA system
- Start and stop HANA system in SAP HANA Studio
- System privilege to start/stop a SAP HANA system

Advertisements