How do you connect to an LDAP server using node-oracledb?(如何使用 node-oracledb 连接到 LDAP 服务器?)
问题描述
我有一个数据库,我可以使用字符串jdbc:oracle:thin@ldap://SERVER_NAME:1234/SERVICE,cn=OracleContext,dc-world"连接到使用 jdbc.
I have a database that I can connect to using jdbc using the string "jdbc:oracle:thin@ldap://SERVER_NAME:1234/SERVICE,cn=OracleContext,dc-world".
但是,当我使用node-oracledb时,这个连接字符串不起作用,大概是因为Node没有使用jdbc.我可以使用什么连接字符串来连接数据库?
However, when I use node-oracledb, this connection string does not work, presumably because Node doesn't use jdbc. What connection string could I use to connect to the database?
推荐答案
没有Easy Connect"可用于 LDAP 的语法,因此您将需要配置 ldap.ora 和 sqlnet.ora 文件并使用非 Easy Connectnode-oracledb 中的字符串别名(或其他工具,如 SQL*Plus、PHP OCI8、Python cx_Oracle、Golang godror 等).
There is no "Easy Connect" syntax available for LDAP so you will need to configure ldap.ora and sqlnet.ora files and use a non-Easy Connect string alias in node-oracledb (or in other tools like SQL*Plus, PHP OCI8, Python cx_Oracle, Golang godror etc).
有人告诉我(!)步骤是:
I'm told (!) the steps are:
调用 netca ->目录使用
Invoke netca -> Directory Usage
通过 netca 配置命名以使用 LDAP->命名方法配置.这将为名称查找设置 sqlnet.ora.
Configure naming to use LDAP by netca->Naming Methods Configuration. This sets up sqlnet.ora for name lookup.
运行 netmgr 设置 ldap 条目或企业管理器设置 ldap.
run netmgr to setup the entry in ldap or Enterprise Manager to setup ldap.
将这些文件复制到运行 Node.js 的机器上的子目录中,并将 TNS_ADMIN 设置为包含这些文件的目录.使用 Instant Client,您可以将其放在 Instant Client 库下的 networkadmin
子目录中.请参阅手动条目 可选 Oracle 网络配置
Copy those files to a subdirectory on the machine where you run Node.js, and set TNS_ADMIN to the directory containing the files. With Instant Client you can put it in the networkadmin
subdirectory under the Instant Client libraries. See the manaul entry Optional Oracle Net Configuration
将 node-oracledb 的 connectString 设置为 3 中配置的连接别名,例如兽人"
Set node-oracledb's connectString to the connect alias configured in 3, e.g. "orcl"
这篇关于如何使用 node-oracledb 连接到 LDAP 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 node-oracledb 连接到 LDAP 服务器?


基础教程推荐
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01