node-oracledb 介绍
node-oracledb 是甲骨文公司官方发布的 Oracle 的 Node.js 驱动。目前最新版本 0.2
还是个预览版本,开发团队还在不断完善,包括对 Windows 平台的支持、LOB 支持、批获取/大查询结果集的流处理以及 DRCP 支持等。
支持 Oracle 的基本和高级特性:
-
使用 javascript 对象和数组进行绑定
-
查询结果返回到 JavaScript 对象和数组
-
可在 JavaScript 和 Oracle 对象间转换
-
事务管理
-
连接池
-
高可用性
示例代码:
var oracledb = require('oracledb'); oracledb.getConnection( { user : "hr", password : "welcome", connectString : "localhost/XE" }, function(err, connection) { if (err) { console.error(err.message); return; } connection.execute( "SELECT department_id, department_name " + "FROM departments " + "WHERE department_id = :did", [180], function(err, result) { if (err) { console.error(err.message); return; } console.log(result.rows); }); });
node-oracledb 官网
https://github.com/oracle/node-oracledb
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。