I am trying to connect to Oracle DB to node JS. SQL developer is already installed and working successfully, SQL developer is connected to server database using tnsnames.ora file. But when i try to run below code
oracledb.getConnection({
user : "Admin",
password : "Password",
connectString : "(DESCRIPTION =(ADDRESS = (PROTOCOL = tcp)(HOST =
xx.xx.xx.xx)(PORT = 1521)) (CONNECT_DATA =(SERVER = DEDICATED)
(SERVICE_NAME = sblbld)))"})
it throws below error:
Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "C:\app\product\1
1.1.0\client_1\bin\oci.dll is not the correct architecture". See https://oracle.
github.io/odpi/doc/installation.html#windows for help
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/
INSTALL.html
You must have 64-bit Oracle client libraries in your PATH environment variable.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from.
Could someone pls help. Thanks
The reason SQL Developer does not complain about the same problem as your node.js app is SQL Developer is using a pure Java JDBC driver to connect to the database. The JDBC thin driver is entirely written in Java and is included in the installation of the product "SQL Developer".
You should get a similar error message if you ask SQL Developer to connect to the database using a thick driver (OCI library)
There are situations where you will need the thick driver to connect in SQL Developer. This link will explain when: https://www.thatjeffsmith.com/archive/2019/04/sql-developer-19-1-connections-thick-or-thin/
Your node.js oracledb module requires a client side library (OCI) in order to connect to the database so please download and install an oracle instant client before any connections are tried.
Best of luck