-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
32 lines (28 loc) · 824 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const express = require('express');
const app = express();
const hdb = require('hdb');
var client = hdb.createClient({
host: 'hxehost',
port: 39015,
user: 'system',
password: 'SapAbap1'
});
app.get('/', (req, res) => {
client.on('error', function (err) {
console.error('Network connection error', err);
});
client.connect(function (err) {
if (err) {
return console.error('Connect error', err);
}
client.exec('select * from DUMMY', function (err, rows) {
client.end();
if (err) {
return console.error('Execute error:', err);
}
res.send(rows);
console.log('Results:', rows);
});
});
});
app.listen(3000, () => console.log('Example app listening on port 3000!'));