Guest User

Untitled

a guest
Apr 13th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. var oracledb=require('oracledb');
  2.  
  3. oracledb.getConnection(
  4. {
  5. user:'ehzawad',
  6. password:'ehzawad',
  7. connectString:'localhost/XE',
  8. },
  9. function(err,connection)
  10. {
  11. if(err)
  12. {
  13. throw err;
  14. console.log("database connection failed");
  15. }
  16. else
  17. {
  18. console.log("database connected");
  19. //module.exports=connection;
  20.  
  21. connection.execute('select * from emp',function(err,result){
  22.  
  23. console.log(result.length+ " "+typeof result);
  24. console.log(result.rows.length);
  25. });
  26.  
  27.  
  28. }
  29. }
  30. );
Add Comment
Please, Sign In to add comment