I read through this issue (https://github.com/oracle/node-oracledb/issues/691) as well as couple others and it did not solve my problem. I am using oracle instant client (client + sdk +sqlplus) 12.2 with the following code:
import oracledb from 'oracledb';
oracledb.getConnection({
user: 'appdba',
password: 'manager',
// connectionString: '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = db1))'
connectionString: 'server1:1521/db1'
// connectionString: 'db1'
}).then(connection => {
console.log('Got connection!');
})
.catch(err => {
console.log(err);
})
my environment variables are set as:
ORACLE_HOME=C:\oracle\instantclient_12_2
OCI_INC_DIR=C:\oracle\instantclient_12_2\sdk\include
OCI_LIB_DIR=C:\oracle\instantclient_12_2\sdk\lib\msvc
TNS_ADMIN=C:\oracle\instantclient_12_2\network\admin
What I tried
err.stack but it returns just Error: ORA-12560: TNS:protocol adapter errorIs there anyway to determine what's wrong or at least print out some debug output to figure things out?
@ShiraazMoollatjie It's connectString, not connectionString.
I have an old note that we should add connectionString as an alias for connectString. A PR is welcome, of course!
@cjbj since you are not really merging those PRs, you can simply ask one of the oracle developers to copy paste the below
connection.js line 97
````js
if (!poolAttrs.connectString) {
poolAttrs.connectString = poolAttrs.connectionString;
}
self._createPool(poolAttrs, function(err, poolInst) {
````
connection.js line 207
````js
if (!connAttrs.connectString) {
connAttrs.connectString = connAttrs.connectionString;
}
self._getConnection(connAttrs, function(err, connInst) {
````
@sagiegurari thanks. I'd like to get some basic test added; we can do that.
@dmcghan That was it!! Not sure where I got connectionString from, but anyway thanks alot!
@sagiegurari the new alias connectionString is now in node-oracledb 2.1.0. Thanks!
Most helpful comment
@ShiraazMoollatjie It's
connectString, notconnectionString.