英文:
Why am I getting the "NJS-138: connections to this database server version are not supported by node-oracledb in Thin mode" error with node-oracledb
问题
I tried using the latest node-oracledb 6.0.1 thin mode to connect my simple Node.js app to my Oracle Database 11g version and got an NJS-138 error.
我尝试使用最新的node-oracledb 6.0.1的Thin模式连接我的简单Node.js应用程序到我的Oracle Database 11g版本,并出现了NJS-138错误。
This gives the following error: NJS-138: connections to this database server version are not supported by node-oracledb in Thin mode
这导致了以下错误:NJS-138: 在Thin模式下,不支持连接到此数据库服务器版本
英文:
I tried using the latest node-oracledb 6.0.1 thin mode to connect my simple Node.js app to my Oracle Database 11g version and got an NJS-138 error.
I ran the following simple app using node-oracledb 6.0.1 in Thin mode:
const oracledb = require('oracledb');
async function runApp() {
let connection;
let dbConfig = {
user : "scott",
password : "tiger",
connectString : "localhost/orclpdb"
};
//oracledb.initOracleClient();
// Get a standalone Oracle Database connection
connection = await oracledb.getConnection(dbConfig);
console.log('Connection was successful!');
// Run a simple SQL on the connection
const sql = `SELECT sysdate FROM dual`;
const result = await connection.execute(sql);
console.log(`The system date and time is:\n${result.rows[0][0]}`);
await connection.close();
if (oracledb.thin)
console.log("Thin mode selected");
else
console.log("Thick mode selected");
console.log("Run at: " + new Date());
console.log("Node.js version: " + process.version + " (" + process.platform, process.arch + ")");
console.log("Node-oracledb version:", oracledb.versionString);
}
runApp();
This gives the following error:
NJS-138: connections to this database server version are not supported by node-oracledb in Thin mode
Why is this error thrown?
答案1
得分: 1
node-oracledb 6.0的Thin模式支持Oracle Database 12.1及更高版本。请查看以下文档:https://node-oracledb.readthedocs.io/en/latest/user_guide/appendix_a.html#id1,以获取Thin模式和Thick模式的支持Oracle版本信息。
Node-oracledb 6.0默认使用'Thin模式'驱动程序。您可以切换到Thick模式以支持Oracle Database 11g,或升级您的数据库版本。
英文:
node-oracledb 6.0 Thin mode supports Oracle Database Release 12.1 and later. Please see the following documentation: https://node-oracledb.readthedocs.io/en/latest/user_guide/appendix_a.html#id1 for the supported Oracle releases for both the Thin and Thick modes.
Node-oracledb 6.0 is a 'Thin mode' driver by default. You can switch to Thick mode for Oracle Database 11g support or upgrade your database version.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论