当前位置:网站首页>How to use node JS access data in SAP Hana cloud database
How to use node JS access data in SAP Hana cloud database
2022-07-21 09:27:00 【Hua Weiyun】
Sign in SAP Business Technology Platform, find space Create it yourself HANA Cloud example , Right click on the menu to select Copy SQL Endpoint, take HANA Cloud Example of endpoint Copy it :
25eeba68-24ce-4b2d-aaa5-ee8d599ff4a0.hana.trial-eu10.hanacloud.ondemand.com:443
We'll be in Node.js In the code , Will use .
Create a new one Node.js application , install hana client Development Library :
npm install --save @sap/hana-client
Complete source code :
var hana = require("@sap/hana-client");var connOptions = { serverNode: "25eeba68-24ce-4b2d-aaa5-ee8d599ff4a0.hana.trial-eu10.hanacloud.ondemand.com:443", encrypt: "true", sslValidateCertificate: "false", uid: "DBADMIN", pwd: "Sgd",};var dbConnection = hana.createConnection();dbConnection.connect(connOptions, function (err) { if (err) throw err; dbConnection.exec( `SELECT TOP 1000 "REGION", "DESCRIPTION"FROM "PLAIN"."REGIONS"`, function (err, result) { if (err) throw err; for( var i = 0; i < result.length; i++) console.log(result[i]); dbConnection.disconnect(); } );});
Execution results :
Node.js The database table printed in the code REGIONS, come from PLAIN schema:
Be careful , Use DBADMIN This user , You can only access the user owned access right Database table of .
For example, we replace it Node.js The name of the accessed database table is DB1.COMMUNITY:
here ,Node.js Application error :
Error: insufficient privilege: Detailed info for this error can be found with guid ‘6F6F68ED5F58804CB8C7B25D7559D0E0’
边栏推荐
- volley7–NetworkDispatcher从网络中获取数据[通俗易懂]
- 2022云计算技能比赛国赛最新资料
- 2022 the 15th Nanjing international industrial automation and industrial robots Exhibition
- 云速直播凭何荣获企业青睐?
- BreederDAO 第一项提案发布:DAO 组织的宪法章程
- Is the higher the yield of financial products, the better?
- 【性能优化】MySQL常用慢查询分析工具
- Smart lamp pole exhibition | 2022 Nanjing International Smart lamp pole and smart street lamp Exhibition
- MySQL乐观锁
- 2022第十四届南京国际智慧工地展览会|智慧工地展
猜你喜欢
一个字符串“0”,竟是B站崩溃的元凶...
2022云计算技能比赛国赛最新资料
YOLOV7:OSError: [WinError 1455] 页面文件太小,无法完成操作的 最终解决方案
【性能优化】MySQL常用慢查询分析工具
Unity Slider滑动条开发
(作业)C语言做题:结构体对齐数、位段、联合体
rank函数的功能有哪些
Baijiayun and Fuwei film, a US listed company, reached a merger agreement: priced at US $520million
蔬菜大棚变身智能工厂!百度智能云助力山东寿光打造智慧农业新标杆
C语言:文件操作:顺序读写、随机读写
随机推荐
Association between roles, roles collection and scopes on SAP BTP
Food in dog days
MySQL显式锁
蔬菜大棚变身智能工厂!百度智能云助力山东寿光打造智慧农业新标杆
如何区分虚拟网卡和物理网卡?
思源能否内置一个密码管理器
vector、queue、stack用法详解
MySQL metadata lock (MDL)
Record Locks(记录锁)
2022 the 15th Nanjing international industrial automation and industrial robots Exhibition
Matlab point cloud roughness calculation
C语言1. 通讯录——结构体+枚举应用
乐观锁悲观锁适用场景
浙江的哪个银行网点可以买到REITs基金产品?
mysql修改密码(手把手教你)
(作业)C语言做题:内存函数memmove、memcpy的模拟
大咖说·图书分享 | HaaS 物联网设备云端一体开发框架
几种在不同的位置打开 SAP HANA Database explorer 的办法
2022云计算技能比赛国赛最新资料
计协C语言第四次培训 练习题