How do you connect to an LDAP server using node-oracledb?

一笑奈何 提交于 2019-12-02 05:18:42

问题


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".

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?


回答1:


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) Invoke netca -> Directory Usage

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

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

4) Copy those files to where you run node, and set TNS_ADMIN to the directory containing the files

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



来源:https://stackoverflow.com/questions/31994159/how-do-you-connect-to-an-ldap-server-using-node-oracledb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!