如何使用node-oracledb连接到LDAP服务器? [英] How do you connect to an LDAP server using node-oracledb?

查看:107
本文介绍了如何使用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?

推荐答案

LDAP没有可用的"Easy Connect"语法,因此您需要 配置ldap.ora和sqlnet.ora文件并使用非Easy Connect node-oracledb(或其他工具,例如SQL * Plus,PHP OCI8,Python cx_Oracle等)中的字符串别名.

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 etc).

我被告知(!)步骤如下:

I'm told (!) the steps are:

1)调用netca->目录使用情况

1) Invoke netca -> Directory Usage

2)通过netca->命名方法配置将命名配置为使用LDAP.这将设置sqlnet.ora进行名称查找.

2) Configure naming to use LDAP by netca->Naming Methods Configuration. This sets up sqlnet.ora for name lookup.

3)运行netmgr来设置ldap中的条目,或者运行企业管理器来设置ldap.

3) run netmgr to setup the entry in ldap or Enterprise Manager to setup ldap.

4)将这些文件复制到运行Node.js的计算机上的子目录,然后将TNS_ADMIN设置为包含文件的目录.使用Instant Client,可以将其放在Instant Client库下的network\admin子目录中.请参阅手册条目可选的Oracle Net Configuration

4) 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 network\admin subdirectory under the Instant Client libraries. See the manaul entry Optional Oracle Net Configuration

5)将node-oracledb的connectString设置为3中配置的连接别名,例如"orcl"

5) Set node-oracledb's connectString to the connect alias configured in 3, e.g. "orcl"

这篇关于如何使用node-oracledb连接到LDAP服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆