DEV Community

Discussion on: Connect to OracleDB from NodeJS?

Collapse
 
janguianof profile image
Jaime Anguiano • Edited

good...try with the embedded connection strings


oracledb.getConnection(
  {
    user          : "hr",
    password      : mypw,  // mypw contains the hr schema password
    connectString : "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mymachine.example.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))"
  } 
Thread Thread
 
thehanna profile image
Brian Hanna

I will definitely give this a try in the morning! Thanks!

Thread Thread
 
thehanna profile image
Brian Hanna

Jaime, THANK YOU!!! Your connection string was a huge help, I finally connected successfully! I ended up having to modify it a bit to match with a value I got from a coworkers tnsnames.ora entry file for the same database, so it ended up looking like this:

(DESCRIPTION=
  (ADDRESS=
    (COMMUNITY=subdomain.company.com)
    (PROTOCOL=TCP)
    (HOST=db.company.com)
    (PORT=port_number)
  )
  (CONNECT_DATA=
    (SID=database_name)
    (GLOBAL_NAME=database_name.company.com)
    (SERVER=DEDICATED)
  )
)
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
ianbromwich profile image
Ian B

this worked for me, thank you so much.