Skip to content

Instantly share code, notes, and snippets.

@ebbersjathomes
Created April 23, 2014 14:54
Show Gist options
  • Save ebbersjathomes/11218528 to your computer and use it in GitHub Desktop.
Save ebbersjathomes/11218528 to your computer and use it in GitHub Desktop.
/**
* Created by jason on 4/22/14.
*/
var async = require("async");
module.exports = function(app){
app.get('/test/oracle',function(req,res,next){
app.logger.info("Start Test route");
async.waterfall([
function(callback){
app.oracleFactory.acquire(callback);
},
function(connection,callback){
connection.execute("SELECT systimestamp FROM dual",[],function(err,result){
callback(err,connection,result);
});
}
],
function(err,connection, results){
connection.release();
if(err){
next(err);
app.logger.info("End Test route error");
} else {
res.json({"status" : true, "rs" : results});
app.logger.info("End Test route success");
}
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment