使用node-oracle访问数据库,并用async.waterfall确认删除数据库时所影响的行数
发布于 12 年前 作者 skyer316 4364 次浏览 最后一次编辑是 8 年前

var bindings = require(’./oracle_bindings’); var async = require(‘async’); var oracle = new bindings.OracleClient();

async.waterfall( [ // i. check if headers.txt exists function ConnectDataBase(callback) { oracle.connect({ “hostname”: “localhost”, “user”: “his”, “password”: “his” }, function(err, connection) { console.log(“conneted”) callback(err,connection); }); }, function DeleteData(connection,callback) { var self=this; this.connection=connection; self.connection.execute(“delete FROM person WHERE NAME = (:1)”, [‘huangwei’],function(err, results) { self.connection.setAutoCommit(true); callback(err,results); });
} ], function(err,results) { if(err) { throw err; } console.log(results);

} );

回到顶部