0
oracledb.getConnection({ user : "", password : "", connectString : "" }, function(err, connection) { if (err) { console.log("Error while trying to connect to DB ", err.message); callback(err.message); } else { //My Logic } });
我正在使用上面的(伪)代码连接到远程的oracledb。我在Windows环境下工作。连接字符串具有连接到远程数据库的URL。现在,如果我的用户名/密码不正确/ null,我能够看到该错误。但是,如果服务器关闭,那么处理错误的部分就不会进入。如何捕获服务器关闭错误?节点oracledb没有检测到服务器是否关机
任何线索都会有帮助。 TIA。
感谢Chris对node-oracledb的持续支持。 – Nigilan
谢谢。我已经在node-oracledb手册中添加了一些注释:https://github.com/oracle/node-oracledb/blob/dev-2.0/doc/api.md#connectionha –