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 服务器?
基础教程推荐
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 无法解决整理冲突 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
