1
votes

I am trying to connect to oracle database by protractor. I tried several node modules but couldn't able to. Finally I trying with oracledb npm. There I am calling getConnnection method the dbConfig as parameter.

dbConfig looks like this. dbConfig={ userName: 'dbName', password : '123123', connectionString: 'jdbc:oracle:thin:@//ocmuat.abc.net:51521/XTS_SIT.SERVER' }

After doing all this, I am getting error saying

ORA-12154: TNS:could not resolve the connect identifier specified

and after this it is getting closed.

Final error message is like

Failures: 1) test db connection tests db connection Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Stack: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.

Where am I doing wrong?

1

1 Answers

1
votes

Node-oracledb is not JDBC so you can't use a JDBC connection string.

Just use:

dbConfig={ userName: 'dbName', password : '123123', connectionString: 'ocmuat.abc.net:51521/XTS_SIT.SERVER' }

There is documentation at https://oracle.github.io/node-oracledb/doc/api.html#notjdbc