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);
} );