I am trying to connect to a database via a port forward on my local windows PC.
Currently I have this all working if I run a sqlplus connect on my local machine in a command prompt.
Example:
Tunnel setup
ssh -N -L 1520:rds.xxxxxx999999.us-east-2.rds.amazonaws.com:1521 -p 22 ubuntu@1.1.1.1 -i ec2-bastion.pem -f
SQL Connect
sqlplus -s user/pass@127.0.0.1:1520/DBSID
This works.
I now want to run this from Express/Node in my backend but I get an error that there is no listener. How can I set this up to where my docker container will connect to the db using my PCs local port forward?
Node Database file for reference:
async function initialize() {
// Set Oracle Pool Settings
let hrPool = {
poolMin: 10,
poolMax: 10,
poolIncrement: 0
}
hrPool.user = 'username'
hrPool.password = 'password'
hrPool.connectString = '127.0.0.1:1520/DBSID'
try {
await oracledb.createPool(hrPool);
} catch (err) {
console.log('Pool Creation Error: ' + err);
}
}
module.exports.initialize = initialize;